Hi Justin,

Please excuse me on my lack of knowledge regarding the GC model.  When we
talk about the "roots", does it mean only roots for marking, or does it
mean roots for both marking and sweeping?  (In the current Ruby GC, I
think the roots are used for marking, while sweeping just goes through the
whole heaps/array.)  Is it possible to have separate sweeping areas?

Regards,

Bill
===========================================================================
Justin Johnson <justinj / mobiusent.com> wrote:

> The garbage collector uses the C/C++ stack to find roots.  Roots can also be
> manually registered.  Any object that is to be controlled by garbage
> collection must be derived from RbObject (which is in turn derived from an
> object called GcObject in my GC library).  When GC objects are being marked,
> the objects gc() method is called to trace other objects to mark.
> gcTraverse() calls into the garbage collector to do bit marking.  It does
> not recurse but uses an iteration technique similar to Cheney's copying.
> Using the gc() method means that the garbage collector knows more about the
> objects it can collect and therefore cuts down on the number of
> misidentifications that the Boehm GC experiences.  It should also make
> marking faster.  This is a little more work for the programmer but I think
> it's worth the small effort.