2012/5/31 Admin Tensor <lists / ruby-forum.com>:
> "Iaki Baz Castillo" <ibc / aliax.net> wrote in post #1062693:
>>     objects = rb_ary_new();
>>     rb_gc_register_address(&objects);
>>
>> I really hope this is NOT possible. If not we are lost. This is, if I
>> create a VALUE in C land it cannot be GC'd in next C function. Hope
>> I'm right here.
>
> Hi,
>
> A long time ago (probably ten years ago) I got a reply from Matz that if
> 'objects' is on the stack, then it is protected (i.e., it will not be
> GC'ed).

Thanks, it makes sense. Otherwise Houston we have a problem!:

  // Create an Array.
  VALUE my_array = rb_ary_new();

  // GC works here and GC's my_arary...

  // Store it in some Hash to avoid GC.
  rb_hash_aset(my_hash, some_key, my_array);

  // BANG !!!!

Obviously it cannot not be possible :)

-- 
Iaki Baz Castillo
<ibc / aliax.net>