Skip to content

Commit

Permalink
[GR-18163] Add rb_gc_mark_locations C function
Browse files Browse the repository at this point in the history
PullRequest: truffleruby/4402
  • Loading branch information
andrykonchin committed Nov 18, 2024
2 parents 4d4f71f + 288c3bb commit b48ba93
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Compatibility:
* Implement `rb_hash_bulk_insert()` (#3705, @Th3-M4jor).
* Remove deprecated `Pathname#{taint,untaint}` methods (#3681, @andrykonchin).
* Add `rb_category_warn` function (#3710, @andrykonchin).
* Add `rb_gc_mark_locations()` (#3704, @andrykonchin).

Performance:

Expand Down
2 changes: 1 addition & 1 deletion lib/cext/include/truffleruby/truffleruby-abi-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
// $RUBY_VERSION must be the same as TruffleRuby.LANGUAGE_VERSION.
// $ABI_NUMBER starts at 1 and is incremented for every ABI-incompatible change.

#define TRUFFLERUBY_ABI_VERSION "3.3.5.2"
#define TRUFFLERUBY_ABI_VERSION "3.3.5.3"

#endif
10 changes: 10 additions & 0 deletions src/main/c/cext/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ void rb_gc_mark(VALUE ptr) {
polyglot_invoke(RUBY_CEXT, "rb_gc_mark", ptr);
}

void rb_gc_mark_locations(const VALUE *start, const VALUE *end) {
VALUE *value = start;

while (value < end) {
rb_gc_mark(*value);
polyglot_invoke(RUBY_CEXT, "rb_gc_mark_maybe", *value);
value++;
}
}

void rb_gc_mark_movable(VALUE obj) {
rb_gc_mark(obj);
}
Expand Down

0 comments on commit b48ba93

Please sign in to comment.