The Trunk: Collections-ul.232.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Collections-ul.232.mcz

commits-2
Andreas Raab uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.232.mcz

==================== Summary ====================

Name: Collections-ul.232
Author: ul
Time: 1 December 2009, 4:35:49 am
UUID: 775f15c4-da80-9b4a-bf1c-a909ad305387
Ancestors: Collections-ul.231

Part 1 of WeakIdentityKeyDictionary hash change.
Also removed previous preamble.

=============== Diff against Collections-ul.231 ===============

Item was changed:
  ----- Method: WeakIdentityKeyDictionary>>scanFor: (in category 'private') -----
  scanFor: anObject
  "Scan the key array for the first slot containing either a nil (indicating an empty slot) or an element that matches anObject. Answer the index of that slot or raise an error if no slot is found. This method will be overridden in various subclasses that have different interpretations for matching elements."
 
+ | index start |
+ CollectionRehashingUtility quickRehashBecause: #weakIdentityKeyDictionaryScanForChanged.
+ index := start := anObject scaledIdentityHash \\ array size + 1.
- | index start hash |
- array size  >= 8192
- ifTrue: [ hash := anObject identityHash * (array size // 4096) ]
- ifFalse: [ hash := anObject identityHash ].
- index := start := hash \\ array size + 1.
  [
  | element |
  ((element := array at: index) == nil or: [ element key == anObject ])
  ifTrue: [ ^index ].
  (index := index \\ array size + 1) = start ] whileFalse.
  self errorNoFreeSpace!

Item was changed:

Item was changed:
  ----- Method: WeakIdentityKeyDictionary>>scanForEmptySlotFor: (in category 'private') -----
  scanForEmptySlotFor: anObject
  "Scan the key array for the first slot containing an empty slot (indicated by a nil). Answer the index of that slot. This method will be overridden in various subclasses that have different interpretations for matching elements."
 
+ | index start |
+ index := start := anObject scaledIdentityHash \\ array size + 1.
- | index start hash |
- array size >= 8192
- ifTrue: [ hash := anObject identityHash * (array size // 4096) ]
- ifFalse: [ hash := anObject identityHash ].
- index := start := hash \\ array size + 1.
  [
  (array at: index) ifNil: [ ^index ].
  (index := index \\ array size + 1) = start ] whileFalse.
  self errorNoFreeSpace!