From: Dan Sugalski Date: 2002-08-25T02:54:36+09:00 Subject: Re: Why Ruby Uses Mark-and-Sweep GC? At 7:49 PM +0900 8/24/02, Mauricio Fern�ndez wrote: >On Sat, Aug 24, 2002 at 12:39:54PM +0900, Perry E. Metzger wrote: >> >> Mauricio Fern�ndez writes: >> > There's however a problem with bringing generational GC to Ruby. If your >> > generations are G0 (newer), G1, ..., when marking objects in G0 you >> > have to go through "root variables"� (frames, globals...) AND the >> > objects in G1, .., Gn which point to things in G0. >> >> This is no different from the generational GC problem in most >> languages. There are several good monographs on garbage collection out >> there that explain how one overcomes such problems in practice. > >But having an automatically managed remembered list (or equivalent >method) only works for code written in Ruby. The programmer must update >it manually in modules in C, which is the issue I was talking about: >the breakage of most extensions... Extensions in C generally need less glue to the GC system with a tracing collector of some sort then they do with a refcounting system. There's still some glue unless you have a really slow GC (one that looks through all allocated data for pointers) but only for pointers to interpreter objects that persist outside the invocation of a particular C function and aren't otherwise attached to the root set. -- Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai dan@sidhe.org have teddy bears and even teddy bears get drunk