Hi,

In message "docs on implementation of ruby and/or ruby-gc ?"
    on 03/04/07, Ruben Vandeginste <Ruben.Vandeginste / cs.kuleuven.ac.be> writes:
|I already sent this to ruby-talk, but maybe ruby-core is a more
|appropriate place to post this...

Perhaps, but it will be same person to answer anyway.

|Are there any docs (online resources, books) available in english on the
|implementation of the ruby interpreter ?

In English?  No.  The source is a complete document (in C).

|I'd like to do some experiments with garbage collection for ruby, and i'd
|like to know how the garbage collector is integrated in the ruby
|interpreter. (everything gc-related in gc.c ?) For example, how hard would
|it be to build a generational collector ?  What code would need to be
|changed to include a software write barrier ?  (is rb_eval in eval.c a
|good starting point ?)

It's not trivial to make it generational.  Masato Kiyama once made
generational GC.  He inserted write barrier everywhere (array store,
hash store, instance variable assignment, etc.), and hacked gc.c

|I also have some questions related to extensions, i've read that
|extensions should register the addresses of the ruby objects they use with
|the gc. Related to this, does that mean that *only* these objects can not
|be moved during gc ?   Or is it that every object (in)directly referenced
|by a registered object should not be moved during gc ?
|Also, is it possible to not use any extensions, so that you could use a
|moving gc ?  Or are some extensions always loaded ?

No object is moved during GC.  It is conservative GC, hence any object
should move.  I'm not sure if it's possible to implement moving
(compacting) conservative GC.  Maybe it can be done by some kind of
"mostly copying" scheme.

|(i read some things about a generational gc for ruby.. there would be one
|included in the 1.8 release, but it's not included in the preview ?  are
|there still plans to include one or not ?  is there an existing
|generational gc for ruby ?)

It would be included in 1.9 development, which must be started soon
after 1.8.0 stable release.

							matz.