Open LinqLover opened 2 years ago
Hi all, hi @eliotmiranda,
I'm still experiencing this issue and issue and would like to solve it. The problem is that the pointer finder sends outboundPointersDo:
and shouldFollowOutboundPointers
to all (reachable) objects in the system, including instances of ProtoObject
. Some proxy classes that do not inherit from Object
might respond with side effects to these messages (e.g., an ObjectTracer
will bring up a debugger, an MCInfoProxy
will perform an expensive materialization[^1], a void ProtoObject basicNew
will raise an MNU).
I see three possible options to fix this:
ProtoObject
looks clean. Con: extra effort for every (!) inheritor of ProtoObject
, legacy code still breaks the pointer finder.Object
to ProtoObject
. Pro: most legacy will not need to be changed, proxies may still choose to customize pointer finding. Con: ProtoObject
interface becomes slightly messier.In the end, the question seems to be about whether pointer finding is a capability that proxies regularly should or want to customize, or whether it should perfectly imitate the object graph/GC as seen/performed by the VM. I tend to the latter perspective, but could also imagine that one might want to use the pointer finder to chase the pointers in a network of connected images (e.g., Croquet). While technically not the cleanest, option 3 would switch the default assumption from 1 to 2 while still leaving proxies the option to opt in.
Looking forward to your opinion!
Best, Christoph
PS: See also this discussion[^2].
[^1]: [squeak-dev] Re: [squeak-dev] Serious garbage/storage leak issue with MCInfoProxy [^2]: [squeak-dev] Re: [squeak-dev] what is a transparent proxy?
PointerFinder>>#follow:from:
sendsshouldFollowOutboundPointers
to all instances in the system, but some instances might be proxies that refuse to implementshouldFollowOutboundPointers
correctly. If the proxy does not work correctly, as is often the case during development, this will break the pointer finder.Maybe
Object>>#shouldFollowOutboundPointers
should be moved into a method onPointerFinder
to avoid method lookup. See also: https://github.com/hpi-swa/Squot/blob/4159c4831b5fef0b02c8e3b43559792f53746391/src/Squot.package/SquotDecorator.class/instance/shouldFollowOutboundPointers.st