<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18928"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px" 
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true" 
name="Compose message area">
<DIV><FONT size=2 face=Arial>Utilities pointersTo: object</FONT></DIV><FONT 
size=2 face=Arial>
<DIV><BR>----<BR><A 
title="http://www.noharmmeansnofoul.org&#10;CTRL + Click to follow link" 
href="http://www.noharmmeansnofoul.org">http://www.noharmmeansnofoul.org</A></DIV>
<DIV>&nbsp;</DIV>
<DIV></FONT>&nbsp;</DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A 
title="mailto:marianopeck@gmail.com&#10;CTRL + Click to follow link" 
href="mailto:marianopeck@gmail.com">Mariano Martinez Peck</A> </DIV>
<DIV><B>Sent:</B> Thursday, July 15, 2010 8:40 AM</DIV>
<DIV><B>To:</B> <A 
title="mailto:vm-dev@lists.squeakfoundation.org&#10;CTRL + Click to follow link" 
href="mailto:vm-dev@lists.squeakfoundation.org">Squeak Development Discussion 
Virtual Machine</A> </DIV>
<DIV><B>Subject:</B> [Vm-dev] Detecting objects that point to an 
object</DIV></DIV></DIV>
<DIV><BR></DIV>
<P>
<HR>

<P></P>Hi folks. I need to know the objects (actually, only how many) that are 
pointing to any object. So...I take an object X, and I want to know how many 
objects are pointing to X. <BR><BR>The only possible I see in Squeak VM is to do 
a full mark over all objects in memory (or starting by the roots). This is time 
consuming and I even need (maybe) to do this check (to know how many objects are 
pointing to an object) for every single object.<BR><BR>So...is there a faster 
solution for this? The only thing I can imagine is to modify the object header, 
maybe create a new type, and add an array with the addresses of the objects that 
are pointing to that object. Or maybe just a counter that I can increase or 
decrease ?<BR><BR>Thanks for any tip. <BR><BR>Mariano<BR></BODY></HTML>