[Pharo-project] Question about MethodContext, tempNames and GC

Mariano Martinez Peck marianopeck at gmail.com
Thu Nov 25 11:56:16 CET 2010


Hi. These days, I needed to implement a loop detector for one of my
projects, and I started to play a lit with thisContext. I've used it before
but not as deep as now. It is AWESOME!!!!

Now...I noticed (and I think this was the most awesome thing) that I can not
only access to senders and their receivers and methods, but also to the
arguments!!!
And then I thought... mmmmmm  how can I access the arguments of a sender of
a sender of .... because I thought they should be garbage collected, but if
I can access. Ok, there is when I discover that this information is stored
in a DebuggerMethodMap and  I guess this guy uses a kind of WeakArray to
store them.

Now, for my loop detector, I use  thisContext to access senders AND I need
to access the arguments of a method of a sender. For that I use the method
ContextPart >> tempsAndValues
The question is....isn't this method quite "fragile"? I mean, doesn't this
work ONLY if a GC was not run between thisContext and that context ?  I am
right ? I need to know this to see if I can trust on this or not.
And if I am right, maybe we can modify and add this info in a comment?

Thanks

Mariano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gforge.inria.fr/pipermail/pharo-project/attachments/20101125/803e332f/attachment.htm>


More information about the Pharo-project mailing list