[squeak-dev] Finalization tests failing

Levente Uzonyi leves at elte.hu
Sun Oct 31 16:34:12 UTC 2010


On Sun, 31 Oct 2010, Igor Stasenko wrote:

> On 31 October 2010 05:50, Levente Uzonyi <leves at elte.hu> wrote:
>> On Sun, 31 Oct 2010, Igor Stasenko wrote:
>>
>>> Hello,
>>>
>>> under VM with new finalization, some tests are failing.
>>> Please, check
>>> http://code.google.com/p/pharo/issues/detail?id=3183
>>> for details.
>>>
>>> it looks like i need to do a different changeset for Squeak
>>
>> Why? Are the tests failing in Squeak? The patches you attached to the issue
>> are both related to Pharo's crappy WeakKeyDictionary implementation.
>>
>
> i'm afraid no.
> Squeak weak dictionary does not overriding associations with nil keys,
> which means that it will grow bigger and bigger when you run image
> under VM with new finalization.

No, it won't. During growing the associations with nil keys will be 
finalized and removed from the WeakKeyDictionary. The same also happens 
if you remove an association. In this case the association's chain will be 
affected. See #noCheckNoGrowFillFrom: and #fixCollisionsFrom:.

There will be another problem with the current implementation of the new 
finalization scheme. Since the new WeakRegistry doesn't remove the 
associations from the dictionary, the installed finalizer 
(#finalizeValues) will be evaluated with the already finalized 
WeakFinalizerItems. This may cause early finalization or raise an error. 
The easiest way to avoid this is to use a better finalizer which does 
nothing if the VM supports the new finalization scheme.


Levente

>
>>
>> Levente
>>
>>>
>>> --
>>> Best regards,
>>> Igor Stasenko AKA sig.
>>>
>>>
>>
>>
>
>
>
> -- 
> Best regards,
> Igor Stasenko AKA sig.
>
>



More information about the Squeak-dev mailing list