Very strange GC behaviour

(Geert Fannes) #1

Can these registers be cleared without doing much damage before doing
the garbage collection, thus providing a less conservative GC.start
function (perhaps with a parameter true or false for easy selection)? I
found a function rb_gc_start in gc.c. I'm guessing this can best be done
before the rb_gc call. Or are things more complicated as they seem...

The Garbage Collector is conservative. If the address of an object
stays in some register, or even some calculation filled a register
with a number that happens to equal the address, the pointed-to object
will not be gc'ed.

regards,

Brian

···

--
http://ruby.brian-schroeder.de/

Stringed instrument chords: http://chordlist.brian-schroeder.de/

(Brian Schröder) #2

Why do you need this. Maybe you are tackling the problem from the
wrong angle if you need to rely so much on the implementation of the
GC. If you describe your problem maybe someone here can find a less
dependant solution.

regards,

Brian

···

On 23/08/05, Geert Fannes <Geert.Fannes@ikanconsulting.com> wrote:

Can these registers be cleared without doing much damage before doing
the garbage collection, thus providing a less conservative GC.start
function (perhaps with a parameter true or false for easy selection)? I
found a function rb_gc_start in gc.c. I'm guessing this can best be done
before the rb_gc call. Or are things more complicated as they seem...

--
http://ruby.brian-schroeder.de/

Stringed instrument chords: http://chordlist.brian-schroeder.de/