From 14f6f7051b9fd226dc209961563879b9cf18759e Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Thu, 30 Oct 2025 11:30:51 -0700 Subject: [PATCH] Fix rb_gc_impl_checking_shareable for modular GC This implements it the same as the other modular GC functions --- gc.c | 5 +++-- gc/gc_impl.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gc.c b/gc.c index 53cfe839d5..a8320246d0 100644 --- a/gc.c +++ b/gc.c @@ -620,6 +620,7 @@ typedef struct gc_function_map { void (*config_set)(void *objspace_ptr, VALUE hash); void (*stress_set)(void *objspace_ptr, VALUE flag); VALUE (*stress_get)(void *objspace_ptr); + bool (*checking_shareable)(void *objspace_ptr); // Object allocation VALUE (*new_obj)(void *objspace_ptr, void *cache_ptr, VALUE klass, VALUE flags, bool wb_protected, size_t alloc_size); size_t (*obj_slot_size)(VALUE obj); @@ -794,6 +795,7 @@ ruby_modular_gc_init(void) load_modular_gc_func(config_get); load_modular_gc_func(stress_set); load_modular_gc_func(stress_get); + load_modular_gc_func(checking_shareable); // Object allocation load_modular_gc_func(new_obj); load_modular_gc_func(obj_slot_size); @@ -874,6 +876,7 @@ ruby_modular_gc_init(void) # define rb_gc_impl_config_set rb_gc_functions.config_set # define rb_gc_impl_stress_set rb_gc_functions.stress_set # define rb_gc_impl_stress_get rb_gc_functions.stress_get +# define rb_gc_impl_checking_shareable rb_gc_functions.checking_shareable // Object allocation # define rb_gc_impl_new_obj rb_gc_functions.new_obj # define rb_gc_impl_obj_slot_size rb_gc_functions.obj_slot_size @@ -2804,8 +2807,6 @@ mark_m_tbl(void *objspace, struct rb_id_table *tbl) } } -bool rb_gc_impl_checking_shareable(void *objspace_ptr); // in defaut/deafult.c - bool rb_gc_checking_shareable(void) { diff --git a/gc/gc_impl.h b/gc/gc_impl.h index 3250483639..2c05fe6cff 100644 --- a/gc/gc_impl.h +++ b/gc/gc_impl.h @@ -54,6 +54,7 @@ GC_IMPL_FN void rb_gc_impl_stress_set(void *objspace_ptr, VALUE flag); GC_IMPL_FN VALUE rb_gc_impl_stress_get(void *objspace_ptr); GC_IMPL_FN VALUE rb_gc_impl_config_get(void *objspace_ptr); GC_IMPL_FN void rb_gc_impl_config_set(void *objspace_ptr, VALUE hash); +GC_IMPL_FN bool rb_gc_impl_checking_shareable(void *objspace_ptr); // Object allocation GC_IMPL_FN VALUE rb_gc_impl_new_obj(void *objspace_ptr, void *cache_ptr, VALUE klass, VALUE flags, bool wb_protected, size_t alloc_size); GC_IMPL_FN size_t rb_gc_impl_obj_slot_size(VALUE obj);