[squeak-dev] Suspiscious "weak" value reclaimed

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Tue Mar 27 10:43:35 UTC 2018


Hi Tim,
yes, MatFileStructureElement class has an instance variable named
weakSubclasses which is a WeakValueDictionary for that purpose.
I used a Dictionary rather than just a WeakArray, because the class also
acts as a namespace (an Environment).
Otherwise, I would need to define a specific kind of environment pointing
weakly to its binding values, and this would create portability problems
for not so much added value (Pharo does not have Environment for example).


2018-03-26 23:25 GMT+02:00 tim Rowledge <tim at rowledge.org>:

>
>
> > On 26-03-2018, at 2:15 PM, Bob Arning <arning315 at comcast.net> wrote:
> >
> > Other that the WeakValueDictionary, is there anything referencing either
> the class or metaclass? If not, then they would be collected. Perhaps VW is
> saving a reference elsewhere?
>
> Usually a class' superclass would point to it with the subclasses array.
> If you were to make classes and *not* install them as a child of some
> superclass then I'd anticipate the class getting collected as soon as there
> are not instances being held onto. You could probably do interesting things
> by having the subclass array be weak and maybe having a mechanism that can
> (re)load a class when actually needed. But wait! That's at least in part
> what Craig has been doing with Context for some time now.
>
>
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Useful Latin Phrases:- Quo signo nata es? = What's your sign?
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20180327/028d54ef/attachment.html>


More information about the Squeak-dev mailing list