[squeak-dev] Undeclared -> WeakIdentityDictionary -> wrong tally -> wrong #size

Levente Uzonyi leves at caesar.elte.hu
Wed Feb 26 13:52:14 UTC 2020


Hi Marcel,

The cause of the problem is that unlike other weak hashed collections, 
WeakIdentityDictionary does not recalculate tally in 
#noCheckNoGrowFillFrom:. And that's a bug, because it lets tally increase 
indefinitely.

The bug appears now, because before Undeclared became a 
WeakIdentityDictionary, #compact, which is part of what ReleaseBuilder 
does, would recalculate the tally via #noCheckNoGrowFillFrom:.

So, even for weak hashed collections, tally should never be larger than 
the actual capacity (not #capacity, which currently implemented as array 
size is a misnomer) of the collection.


Levente

On Wed, 26 Feb 2020, marcel.taeumel wrote:

> Maybe weak collections should never claim to be empty anymore after any
> element was added to them? I would understand that since repeated calls can
> return different results.
>
> Best,
> Marcel
>
>
>
> --
> Sent from: http://forum.world.st/Squeak-Dev-f45488.html


More information about the Squeak-dev mailing list