From: Joel VanderWerf Date: 2007-11-12T04:06:53+09:00 Subject: Re: JRuby performance questions answered evanwebb@gmail.com wrote: > On Nov 11, 6:11 am, Laurent Sansonetti ... >> On a completely unrelated note, I was wondering... how did you manage >> to keep compatibility with existing C extensions without requiring the >> developer to explicitly set write barriers, in some cases? >> > > The key is that C extensions don't have direct access to object > references. A C extension accesses all objects via a handle table. A > handle is what a C extension sees as an object. This lets the GC > mutate objects (which are also in the handle table) but keep the > handles at constant addresses (so they can be stored on the C stack). > > The big problem with this approach is the RARRAY(), RSTRING(), etc > macros, that access an object directly as C data structure. Thats the > main reason for trying to move MRI away from using these macros and to > using something that looks like a function call that we in rubinius > can implement differently. The extension code must also lock the handle and unlock in rb_ensure? -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407