A Better (different) WeakArray

David T. Lewis lewis at mail.msen.com
Sat Feb 18 22:30:51 UTC 2006


On Sat, Feb 18, 2006 at 01:56:50PM -0800, Andreas Raab wrote:
> Unfortunately, this doesn't work. The reason for using #rehash was that 
> when a key in a weak key dictionary gets eliminated that key's hash 
> changes. Your implementation doesn't account for that and will break in 
> the face of some actual finalized keys in the dictionary.
> 
> Cheers,
>    - Andreas

Darn. Thanks for looking at this.

But just so I understand, I'm deleting any entries with nil keys
within the range of entries being rehashed (up to the next nil
entry), so I thought that this would take care of the case of
entries within that range that had been eliminated by the garbage
collector. The idea was that the finalization process, which still
does the full rehash, would take care of the rest. What did I miss?

Thanks and sorry if I'm being dense.

Dave

p.s. To the extent that I understand this at all, your
ObjectMemory>>aFinalizationComment was very helpful, thanks
for documenting this.




More information about the Squeak-dev mailing list