[Vm-dev] Detecting objects that point to an object

Bert Freudenberg bert at freudenbergs.de
Tue Jul 20 18:20:01 UTC 2010


On 20.07.2010, at 04:47, Mariano Martinez Peck wrote:

> 
> 
> On Mon, Jul 19, 2010 at 7:59 PM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>  
> 
> 
> On Mon, Jul 19, 2010 at 7:35 AM, Igor Stasenko <siguctua at gmail.com> wrote:
> 
> Mariano, can you tell us, why you need to know, how many objects pointing to
> a specific one?
> The reference counting is well known solution to this, but it is less
> effective than garbage collection
> (in terms of memory management), since you have to touch the counters
> at each memory write.
> 
> and recursively when objects are freed.
> 
> Further, for two reasons one will also need a scan-mark garbage collector to collect all garbage.  It is inevitable that one won't waste space on a reference count that can hold the max number of references and so the system will have to deal with a max count and have some objects with an overflowed count.  Reference counting cannot easily deal with circularities and so a cycle of references will result in non-zero ref counts for nodes in the cycle and prevent garbage collection.
> 
> 
> 
> Thanks for the answers. Maybe I should have explained why I needed that. What I had in mind, is to be able to detect subgraphs. But not any kind of subgraphs, but only those on which ALL objects are ONLY reachable from the root of the subgraph. This means, that there are no objects outside the graph, pointing to objects inside the graph. In ImageSegment word, would mean to detect subgraphs that don't have outPointers. 


So why not simply use an ImageSegment? IIRC that's how Croquet islands are checked for closedness.

- Bert -


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20100720/b011591b/attachment.htm


More information about the Vm-dev mailing list