From: "Perry E. Metzger" Date: 2002-08-26T11:05:40+09:00 Subject: Re: Why Ruby Uses Mark-and-Sweep GC? Mauricio Fern�ndez writes: > 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... There are languages like Elk (a Scheme dialect) that dealt with relocating collectors by using precise collection and having C extensions explicitly declare pointers into the lisp heap. That sort of technique is straightforward to apply in something like Ruby, although not necessarily *pleasant* to apply. -- Perry E. Metzger perry@piermont.com -- "Ask not what your country can force other people to do for you..."