On Sat, Aug 24, 2002 at 04:59:15AM +0900, William Djaja Tjokroaminata wrote: > Hi, > > Probably I should ask this question instead, to people who are really > familiar with the internals of Ruby object and Ruby gc: > > Will it be tricky to try to separate Ruby objects that will be involved in > the mark-and-sweep and those that won't (from C)? > > For example, the simple function "rb_global_variable" registers the VALUE > address that will be marked (and therefore will not be swept). Is it > possible to create a perfectly valid Ruby object (VALUE) that will not be > swept? In other words, the Ruby gc will not be aware of the existence of > such objects. By using rb_global_variable (which simply calls rb_gc_register_address(&value)), the VALUE is always marked, but the gc _is_ aware of its existence. It simply won't be swept until you do rb_gc_unregister_address() it. But the marking phase isn't any faster. It's still O(R) :-| -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com <|ryan|> I don't use deb <netgod> u poor man <Disconnect> netgod: heh <Kingsqueak> apt-get install task-p0rn