Sean O'Dell wrote:
> I guess I don't understand how GC works.  I assumed that it walks the entire
> list of living objects and gets rid of the ones no longer in use.  It seems
> that it would be easier to just check one object rather than every object in
> the list.

GC starts with objects that are known to be reachable, like the values
of global vars, constants, stuff on the stack. Then it walks through the
objects that their variables reference, and so on, recursively.

You have to traverse all reachable objects before you know if any
particular object is garbage. How would you check just one object,
unless you were using ref counting?