From 5341e8cda8004848c9b7ecc5f244639acb2d6894 Mon Sep 17 00:00:00 2001 From: Andrew Konchin Date: Thu, 21 Nov 2024 17:30:24 +0200 Subject: [PATCH] Fix rb_gc_mark_locations and don't mark object repeatedly --- lib/cext/ABI_check.txt | 2 +- src/main/c/cext/gc.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/cext/ABI_check.txt b/lib/cext/ABI_check.txt index 00750edc07d6..b8626c4cff28 100644 --- a/lib/cext/ABI_check.txt +++ b/lib/cext/ABI_check.txt @@ -1 +1 @@ -3 +4 diff --git a/src/main/c/cext/gc.c b/src/main/c/cext/gc.c index 703aa3657b81..f1b7d233f2d7 100644 --- a/src/main/c/cext/gc.c +++ b/src/main/c/cext/gc.c @@ -38,8 +38,7 @@ 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); + rb_gc_mark_maybe(*value); value++; } }