From: "Iñaki Baz Castillo" Date: 2012-05-18T04:24:32+09:00 Subject: Re: rb_gc_register_address() or rb_gc_mark()? 2012/5/17 Iñaki Baz Castillo : > Ok, after some experiment I'm confused: > > - I run GC.startt every 0.1 seconds. > > - While my_class instance (which wraps the C struct referencing > my_string VALUE) remains in the scope (or stored in a global variable) > my_string is NOT GC'd. I know it because I've stored its object_id and > used it in ObjectSpace._id2ref(id) and it returns my_string. > > So... even if I've seen the usage of rb_gc_mark() in some C > extensions, in my experiments it does nothing. Any help would be > appreciated. Forget it please! I was storing my_string in a class attribute :( Yes, rb_gc_mark() stuf is fully understood. Now I will investigate what rb_gc_(un)register does, since in my experiments it does NOTHING. -- Iñaki Baz Castillo