Pointer Detective

Ben Coman proposed a new pointer analysis tool :)

greetings all, I had an itch to scratch... I find it difficult using the tree list of the standard Pointer Explorer to track down why objects aren't garbage collected. I always fear I'm not going to notice getting caught in a reference loop. So I created a tool presenting an alternative view as a directed graph. The graph incrementally builds out from the target object as you explore it. Nodes are colourised to help manage complexity. The attached snapshot is produced from evaluating the following Workspace script... testObject := 'END5'. ref1 := { testObject. nil }. ref2 := { ref1 }. ref3 := PDTestResource new heldObject: ref2. ref1 at: 2 put: ref3. "note the reference loop this creates" PointerDetective openOn: testObject. Now I expect I'm duplicating something done before, but I couldn't find anything quickly and it was an opportunity for some goal direct learning of Morphic. Thanks to Roassal an option for a spring-force layout is provided. That code was copied rather than create a dependency, and might need to be rationalized later. The code is a bit rough from hacking around learning how to make things work, but its functional, so its time to get it out in the open. For more information please refer to the repository home page... http://smalltalkhub.com/#!/~BenComan/PointerDetective cheers -ben


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: