From: William Djaja Tjokroaminata Date: 2002-08-26T22:59:37+09:00 Subject: Re: Why Ruby Uses Mark-and-Sweep GC? Hi, Thanks for the response. Yes, after examining the codes further, it seems that rb_gc_register_address() and rb_gc_unregister_address() will not accomplish what I want. Using rb_gc_unregister_address() will only result in the object being not-marked, but not being not-swept. It seems that a valid VALUE can only be obtained from "freelist", which is obtained from the "heaps". I guess this has something to do with "31-bit" model of Ruby objects (which I guess was designed to work efficiently with Fixnum, Symbol, true, false, and nil). If VALUE is a pure pointer, then I guess there will be no this kind of limitation. Now, if only I can create a second "heaps" whose VALUE's will not be swept... Regards, Bill ============================================================================ Mauricio Fern?ndez wrote: > 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) :-|