Add rb_gc_impl_active_gc_name to gc/gc_impl.h

This commit is contained in:
Peter Zhu 2024-12-05 16:06:18 -05:00
parent 48443c0204
commit c45503f957
Notes: git 2024-12-06 15:22:24 +00:00
3 changed files with 5 additions and 7 deletions

9
gc.c
View File

@ -693,14 +693,13 @@ typedef struct gc_function_map {
VALUE (*latest_gc_info)(void *objspace_ptr, VALUE key); VALUE (*latest_gc_info)(void *objspace_ptr, VALUE key);
VALUE (*stat)(void *objspace_ptr, VALUE hash_or_sym); VALUE (*stat)(void *objspace_ptr, VALUE hash_or_sym);
VALUE (*stat_heap)(void *objspace_ptr, VALUE heap_name, VALUE hash_or_sym); VALUE (*stat_heap)(void *objspace_ptr, VALUE heap_name, VALUE hash_or_sym);
const char *(*active_gc_name)(void);
// Miscellaneous // Miscellaneous
size_t (*obj_flags)(void *objspace_ptr, VALUE obj, ID* flags, size_t max); size_t (*obj_flags)(void *objspace_ptr, VALUE obj, ID* flags, size_t max);
bool (*pointer_to_heap_p)(void *objspace_ptr, const void *ptr); bool (*pointer_to_heap_p)(void *objspace_ptr, const void *ptr);
bool (*garbage_object_p)(void *objspace_ptr, VALUE obj); bool (*garbage_object_p)(void *objspace_ptr, VALUE obj);
void (*set_event_hook)(void *objspace_ptr, const rb_event_flag_t event); void (*set_event_hook)(void *objspace_ptr, const rb_event_flag_t event);
void (*copy_attributes)(void *objspace_ptr, VALUE dest, VALUE obj); void (*copy_attributes)(void *objspace_ptr, VALUE dest, VALUE obj);
// GC Identification
const char *(*active_gc_name)(void);
bool modular_gc_loaded_p; bool modular_gc_loaded_p;
} rb_gc_function_map_t; } rb_gc_function_map_t;
@ -845,14 +844,13 @@ ruby_modular_gc_init(void)
load_modular_gc_func(latest_gc_info); load_modular_gc_func(latest_gc_info);
load_modular_gc_func(stat); load_modular_gc_func(stat);
load_modular_gc_func(stat_heap); load_modular_gc_func(stat_heap);
load_modular_gc_func(active_gc_name);
// Miscellaneous // Miscellaneous
load_modular_gc_func(obj_flags); load_modular_gc_func(obj_flags);
load_modular_gc_func(pointer_to_heap_p); load_modular_gc_func(pointer_to_heap_p);
load_modular_gc_func(garbage_object_p); load_modular_gc_func(garbage_object_p);
load_modular_gc_func(set_event_hook); load_modular_gc_func(set_event_hook);
load_modular_gc_func(copy_attributes); load_modular_gc_func(copy_attributes);
//GC Identification
load_modular_gc_func(active_gc_name);
# undef load_modular_gc_func # undef load_modular_gc_func
@ -929,14 +927,13 @@ ruby_modular_gc_init(void)
# define rb_gc_impl_latest_gc_info rb_gc_functions.latest_gc_info # define rb_gc_impl_latest_gc_info rb_gc_functions.latest_gc_info
# define rb_gc_impl_stat rb_gc_functions.stat # define rb_gc_impl_stat rb_gc_functions.stat
# define rb_gc_impl_stat_heap rb_gc_functions.stat_heap # define rb_gc_impl_stat_heap rb_gc_functions.stat_heap
# define rb_gc_impl_active_gc_name rb_gc_functions.active_gc_name
// Miscellaneous // Miscellaneous
# define rb_gc_impl_obj_flags rb_gc_functions.obj_flags # define rb_gc_impl_obj_flags rb_gc_functions.obj_flags
# define rb_gc_impl_pointer_to_heap_p rb_gc_functions.pointer_to_heap_p # define rb_gc_impl_pointer_to_heap_p rb_gc_functions.pointer_to_heap_p
# define rb_gc_impl_garbage_object_p rb_gc_functions.garbage_object_p # define rb_gc_impl_garbage_object_p rb_gc_functions.garbage_object_p
# define rb_gc_impl_set_event_hook rb_gc_functions.set_event_hook # define rb_gc_impl_set_event_hook rb_gc_functions.set_event_hook
# define rb_gc_impl_copy_attributes rb_gc_functions.copy_attributes # define rb_gc_impl_copy_attributes rb_gc_functions.copy_attributes
// GC Identification
# define rb_gc_impl_active_gc_name rb_gc_functions.active_gc_name
#endif #endif
static VALUE initial_stress = Qfalse; static VALUE initial_stress = Qfalse;

View File

@ -106,6 +106,7 @@ GC_IMPL_FN size_t rb_gc_impl_gc_count(void *objspace_ptr);
GC_IMPL_FN VALUE rb_gc_impl_latest_gc_info(void *objspace_ptr, VALUE key); GC_IMPL_FN VALUE rb_gc_impl_latest_gc_info(void *objspace_ptr, VALUE key);
GC_IMPL_FN VALUE rb_gc_impl_stat(void *objspace_ptr, VALUE hash_or_sym); GC_IMPL_FN VALUE rb_gc_impl_stat(void *objspace_ptr, VALUE hash_or_sym);
GC_IMPL_FN VALUE rb_gc_impl_stat_heap(void *objspace_ptr, VALUE heap_name, VALUE hash_or_sym); GC_IMPL_FN VALUE rb_gc_impl_stat_heap(void *objspace_ptr, VALUE heap_name, VALUE hash_or_sym);
GC_IMPL_FN const char *rb_gc_impl_active_gc_name(void);
// Miscellaneous // Miscellaneous
GC_IMPL_FN size_t rb_gc_impl_obj_flags(void *objspace_ptr, VALUE obj, ID* flags, size_t max); GC_IMPL_FN size_t rb_gc_impl_obj_flags(void *objspace_ptr, VALUE obj, ID* flags, size_t max);
GC_IMPL_FN bool rb_gc_impl_pointer_to_heap_p(void *objspace_ptr, const void *ptr); GC_IMPL_FN bool rb_gc_impl_pointer_to_heap_p(void *objspace_ptr, const void *ptr);