Skip to content
Browse files

Add rb_gc_mark_locations to the C-API

  • Loading branch information...
1 parent 07ea04e commit f47361d39baf77d555ab97568700309440a36f78 @dbussink dbussink committed
Showing with 11 additions and 0 deletions.
  1. +2 −0 vm/capi/18/include/ruby.h
  2. +2 −0 vm/capi/19/include/ruby/ruby.h
  3. +7 −0 vm/capi/gc.cpp
View
2 vm/capi/18/include/ruby.h
@@ -1210,6 +1210,8 @@ VALUE rb_uint2big(unsigned long number);
/** Mark ruby object ptr. */
void rb_gc_mark(VALUE ptr);
+ /** Mark a list of Ruby object ptr's. */
+ void rb_gc_mark_locations(VALUE*, VALUE*);
/**
* Marks an object if it is in the heap. Equivalent to rb_gc_mark in
View
2 vm/capi/19/include/ruby/ruby.h
@@ -1327,6 +1327,8 @@ VALUE rb_uint2big(unsigned long number);
/** Mark ruby object ptr. */
void rb_gc_mark(VALUE ptr);
+ /** Mark a list of Ruby object ptr's. */
+ void rb_gc_mark_locations(VALUE*, VALUE*);
/**
* Marks an object if it is in the heap. Equivalent to rb_gc_mark in
View
7 vm/capi/gc.cpp
@@ -55,6 +55,13 @@ extern "C" {
}
}
+ void rb_gc_mark_locations(VALUE *start, VALUE *end) {
+ VALUE *v = start;
+ while (v < end) {
+ rb_gc_mark(*v++);
+ }
+ }
+
/* In MRI, this function marks an object if it can be determined
* to be in the heap.
*/

0 comments on commit f47361d

Please sign in to comment.
Something went wrong with that request. Please try again.