Be careful, problem with WeakOrderedCollection in Pharo (there is a fix)

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

Be careful, problem with WeakOrderedCollection in Pharo (there is a fix)

Mariano Martinez Peck
Hi Chris. We found a problem with WeakOrderedCollection in Pharo which may cause problems in Magma users in Pharo. Basically, once a WeakOrderedCollection needed to #grew, it stops being weak because the internal array was replaced by a Array instead of a WeakArray. 

(WeakOrderedCollection new instVarNamed: 'array') class ->>>> WeakArray 
 

(WeakOrderedCollection new grow instVarNamed: 'array') class  ->>>> Array

So....I can imagine that some applications running magma may grow a lot due to this bug.

Just to check whether someone is having this bug or not, you may want to execute:

WeakOrderedCollection allInstances select: [:each | (each instVarNamed: 'array') class = Array ]

if you have instances, then that's a problem ;)

To fix it, you can fileine the changes of the issue tracker:
http://code.google.com/p/pharo/issues/detail?id=4596

and then you should fix the already created instances.

cheers

ps: I have no idea how much Magma uses WeakOrderedCollection, but I thought it was just worth it to raise a warning.

--
Mariano
http://marianopeck.wordpress.com


_______________________________________________
Magma mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/magma
Reply | Threaded
Open this post in threaded view
|

Re: Be careful, problem with WeakOrderedCollection in Pharo (there is a fix)

Chris Muller-3
Ok, thanks for the note.

I just skimmed through the issue in tracker and it sounds like Marcus
has it straightened out..  I'm glad Pharo decided to keep
WeakOrderedCollection and refer to #arrayType in OrderedCollection
rather than hard-coded Array.

 - Chris


On Mon, Aug 8, 2011 at 6:21 AM, Mariano Martinez Peck
<[hidden email]> wrote:

> Hi Chris. We found a problem with WeakOrderedCollection in Pharo which may
> cause problems in Magma users in Pharo. Basically, once a
> WeakOrderedCollection needed to #grew, it stops being weak because the
> internal array was replaced by a Array instead of a WeakArray.
>
> (WeakOrderedCollection new instVarNamed: 'array') class ->>>> WeakArray
>
>
> (WeakOrderedCollection new grow instVarNamed: 'array') class  ->>>> Array
>
> So....I can imagine that some applications running magma may grow a lot due
> to this bug.
>
> Just to check whether someone is having this bug or not, you may want to
> execute:
>
> WeakOrderedCollection allInstances select: [:each | (each instVarNamed:
> 'array') class = Array ]
>
> if you have instances, then that's a problem ;)
>
> To fix it, you can fileine the changes of the issue tracker:
> http://code.google.com/p/pharo/issues/detail?id=4596
>
> and then you should fix the already created instances.
>
> cheers
>
> ps: I have no idea how much Magma uses WeakOrderedCollection, but I thought
> it was just worth it to raise a warning.
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
>
> _______________________________________________
> Magma mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/magma
>
>
_______________________________________________
Magma mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/magma