From: Achilleas Margaritis (axilmar_at_[hidden])
Date: 2007-09-17 04:30:19


Larry Evans wrote:
> On 09/16/07 16:56, Achilleas Margaritis wrote:
>> Dear boost developers,
>>
>> You can find a new version of my portable precise C++ garbage collector
>> in vault/memory.
>>
>> Is any one interested?
> How does this collector determine the location of pointers on the stack
> and within the heap?

An internal bit map is used as a pointer database. Each bit represents
one pointer location in memory.

When the class gc_ptr<T> is created, the bit that corresponds to the
pointer's address is set.

When a pointer is destroyed, the same bit is reset.

The bitmap is organized in pages of 4K and allocated dynamically.

The collector sweeps unused pages at collection time.