Status: Accepted
Owner: marianopeck
CC:
[hidden email]
New issue 5196 by marianopeck: PointerFinder new checkbox "Only show strong
references"
http://code.google.com/p/pharo/issues/detail?id=5196After the discussion of whether #pointsTo: (issue 5163) should include weak
reference or not..we decided that by defualt they should be included,
because at the end they are pointers ;)
However, Henry suggested the following:
-------
A weak pointer to an object is still a pointer, no?
As long as the tool is called PointerFinder, and not
GarbageCollectionBlockingObjectsTool, I don't see why you should use a
method which treats them specially :)
Even if that's what you want them to do, why not rather use a method which
actually return all the pointers, and then have a checkbox in
PointerFinder "Only show strong references", where you can selectively hide
the weak refs?
ie. to me PointerFinder might as well use the original method:
pointsTo: anObject
^self class == anObject or: [self instVarsInclude: anObject]
but include some additional checkButtons, which if unticked does filtering
of the refs you don't want to see:
removeWeakRefs
weakRefs := allReferringObjects removeAllSuchThat: [:each |
each class ~= referencedObject and: [
each class isWeak
and: [|holdsWeakly|
holdsWeakly := false.
1 to: each basicSize do: [:i| holdsWeakly := holdsWeakly or: [(self
basicAt: i) == anObject]]]]]
removeInstanceRefs
instanceRefs := allReferringObjects removeAllSuchThat: [:each | each class
== referencedObject]
-----
_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker