Fix rb_gc_impl_checking_shareable for modular GC

This implements it the same as the other modular GC functions
This commit is contained in:
John Hawthorn 2025-10-30 11:30:51 -07:00
parent ee74b97e52
commit 14f6f7051b
Notes: git 2025-11-04 17:29:21 +00:00
2 changed files with 4 additions and 2 deletions

5
gc.c
View File

@ -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)
{

View File

@ -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);