[Gc] Re: GC needs to be invoked manually

Larry Evans cppljevans at cox-internet.com
Sun Aug 28 13:04:43 PDT 2005

On 08/26/2005 03:56 PM, Martin Wartens wrote:
> Meanwhile I discovered that I have to replace "traceable_allocator" 
> with "gc_allocator" to make the sample program work. traceable_allocator uses 
>> ever collected. This behavior also depends on the size of the array. Collection 
> fails if the array has more than 26 entries (=104 bytes).

The code at:


uses reference counting, but that's just one gc policy.  It's fairly
easy to convert to just use a single boolean mark or bit instead of
a reference count to save memory and time to do the refcount updates.

The code also demonstrates that cycles are no problem with refcounting
if it's combined with the backup marksweep of [chri84] cited here:


I'd be happy to add this extra gc policy if you're interested.



More information about the Gc mailing list