The loop doesn't iterate over the indexable slots, only named ones.So..I am puzzle again. I said "In which scenario can � � (self
instVarsInclude: anObject) �answer true, but the loop false? "
you answered: "The scenario happens when the receiver has weak slots and
the argument is referenced from one of those weak slots, but not from the
other slots."
Imagine the receiver has a weak slot XXX that points to anObject. So (self
instVarsInclude: anObject) answers true. � How can the loop answer false
without a GC?
why would XXX stop pointing to anObject if there is not GC in the middle ?
Levente
thanks
Levente
�doesn't #instVarsInclude do exactly what you are doing there?
Just partially. Since we have no information about which slots hold the
reference to the argument, therefore this loop must be "repeated".
Ok, I see.
PointerFinderTest are green :)
�Anyway, I have integrated your changes in Pharo, but still, I have the
sameThe assetion fails, because the indirection vector (the Array found by
problem :(
If I understand correctly, the following shouldn't fail, but it does.
Here
is the version of Squeak that fails.
PointerFinder) holds a reference to the object after the first assignment
to a. If you move the temporary inside the block or use an inlined loop
(e.g. #to:do: with literal block argument), then the assertion won't
fail.
So this is just a normal (maybe surprising) reference to the object.
�Excellent. Now I got it. Thank you very much for your help Levente. Now
Levente
�| a |
10 timesRepeat: [
a := Date new.
Smalltalk garbageCollect.
self assert: (PointerFinder pointersTo: a) isEmpty
]
Thanks a lot,
On Mon, Jan 9, 2012 at 2:40 PM, Levente Uzonyi <leves@elte.hu> wrote:
On Sun, 8 Jan 2012, Mariano Martinez Peck wrote:
�What I don't understand is why in Squeak it does work.
methods,
problem in
�Because #pointsTo: is not used in Squeak (yet). As usual I dugthan
deeper
I should have, so I'll publish a few changes soon.
�Ok, you are right. Squeak #inboundPointersExcluding: �is using
�#instVarsInclude: �rather than #pointsTo. And that solves the
Pharo as well. But still, I would like to understand why we get those
method contexts with #pointsTo.
�Because #pointsTo: is a normal message send, it even sends other
so it will create contexts.
�Thanks Levente for your help. If you find something let us know, I
want
to
�learn :)
this
�I pushed my changes to the Squeak Inbox, which fully works around
issue. The changes about weak references can simply be removed if you
don't
like them, the rest will just work without them.
Levente
�Thanks
�Levente
�Thanks in advance Levente!
�--
�it will create at least one new MethodContext which is not included
in
�that list.
Levente
�Levente
�Thanks again.
�Levente
�Do you mean what I understand :)? that some tools compiled
methods?
:)
�Stef
�Mariano
http://marianopeck.wordpress.
�--
�Mariano
�http://marianopeck.wordpress.**************com <
****
com <http://marianopeck.wordpress.**********com<
http://marianopeck.****
wordpress.com <http://marianopeck.wordpress.******com<
http://marianopeck.**wordpress**.com <http://wordpress.com><
http://marianopeck.wordpress.************com <
http://marianopeck.wordpress.
****
com <http://marianopeck.wordpress.********com<
http://marianopeck.****
wordpress.com <http://marianopeck.wordpress.****com<
http://marianopeck.**wordpress.com<http://marianopeck.wordpress.com>
�--
�Mariano
http://marianopeck.wordpress.**********com <
http://marianopeck.wordpress.
****
com <http://marianopeck.wordpress.******com<http://marianopeck.**
wordpress.com <http://marianopeck.wordpress.**com<http://marianopeck.wordpress.com>
�--
Mariano
http://marianopeck.wordpress.********com <
http://marianopeck.wordpress.
****
com <http://marianopeck.wordpress.****com<http://marianopeck.**
wordpress.com <http://marianopeck.wordpress.com>>
Mariano
http://marianopeck.wordpress.******com <http://marianopeck.wordpress.
****
com <http://marianopeck.wordpress.**com<http://marianopeck.wordpress.com>
--
Mariano
http://marianopeck.wordpress.****com <http://marianopeck.wordpress.**
com <http://marianopeck.wordpress.com>>
--
Mariano
http://marianopeck.wordpress.com