Tell Garbage Collector which objects you use. Ruby takes care of object lifecycle; C doesn't. If you still need objects, mark them in use.
void mark(void* p) {
auto* hash = reinterpret_cast<ruby_hash_t*>(p);
for (auto& iter: *hash) {
rb_gc_mark(iter.first);
rb_gc_mark(iter.second);
}
}
Mark and Sweep
If you don't mark, Ruby releases the memory. Nil starts to appear in random places. Might crash in worst case.
Alias of a long, 64 bit integer (on 64 bit Linux).
Struct with flags and class.
VALUE initialize(VALUE self) {
return self;
}
def initialize
end