Skip to content

Commit ee6f175

Browse files
committed
Implement rb_gc_register_mark_object
1 parent 610b16e commit ee6f175

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/truffle/truffle/cext.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,6 +1410,12 @@ def rb_gc
14101410
GC.start
14111411
end
14121412

1413+
GC_ROOTS = []
1414+
1415+
def rb_gc_register_mark_object(obj)
1416+
GC_ROOTS.push obj
1417+
end
1418+
14131419
def rb_nativethread_self
14141420
Thread.current
14151421
end

src/main/c/cext/ruby.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4715,7 +4715,7 @@ void rb_define_virtual_variable(const char *name, VALUE (*getter)(ANYARGS), void
47154715
}
47164716

47174717
void rb_gc_register_mark_object(VALUE obj) {
4718-
rb_tr_error("rb_gc_register_mark_object not implemented");
4718+
RUBY_CEXT_INVOKE("rb_gc_register_mark_object", obj);
47194719
}
47204720

47214721
ID rb_check_id(volatile VALUE *namep) {

0 commit comments

Comments
 (0)