Skip to content

Commit c45503f

Browse files
committed
Add rb_gc_impl_active_gc_name to gc/gc_impl.h
1 parent 48443c0 commit c45503f

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

gc.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -693,14 +693,13 @@ typedef struct gc_function_map {
693693
VALUE (*latest_gc_info)(void *objspace_ptr, VALUE key);
694694
VALUE (*stat)(void *objspace_ptr, VALUE hash_or_sym);
695695
VALUE (*stat_heap)(void *objspace_ptr, VALUE heap_name, VALUE hash_or_sym);
696+
const char *(*active_gc_name)(void);
696697
// Miscellaneous
697698
size_t (*obj_flags)(void *objspace_ptr, VALUE obj, ID* flags, size_t max);
698699
bool (*pointer_to_heap_p)(void *objspace_ptr, const void *ptr);
699700
bool (*garbage_object_p)(void *objspace_ptr, VALUE obj);
700701
void (*set_event_hook)(void *objspace_ptr, const rb_event_flag_t event);
701702
void (*copy_attributes)(void *objspace_ptr, VALUE dest, VALUE obj);
702-
// GC Identification
703-
const char *(*active_gc_name)(void);
704703

705704
bool modular_gc_loaded_p;
706705
} rb_gc_function_map_t;
@@ -845,14 +844,13 @@ ruby_modular_gc_init(void)
845844
load_modular_gc_func(latest_gc_info);
846845
load_modular_gc_func(stat);
847846
load_modular_gc_func(stat_heap);
847+
load_modular_gc_func(active_gc_name);
848848
// Miscellaneous
849849
load_modular_gc_func(obj_flags);
850850
load_modular_gc_func(pointer_to_heap_p);
851851
load_modular_gc_func(garbage_object_p);
852852
load_modular_gc_func(set_event_hook);
853853
load_modular_gc_func(copy_attributes);
854-
//GC Identification
855-
load_modular_gc_func(active_gc_name);
856854

857855
# undef load_modular_gc_func
858856

@@ -929,14 +927,13 @@ ruby_modular_gc_init(void)
929927
# define rb_gc_impl_latest_gc_info rb_gc_functions.latest_gc_info
930928
# define rb_gc_impl_stat rb_gc_functions.stat
931929
# define rb_gc_impl_stat_heap rb_gc_functions.stat_heap
930+
# define rb_gc_impl_active_gc_name rb_gc_functions.active_gc_name
932931
// Miscellaneous
933932
# define rb_gc_impl_obj_flags rb_gc_functions.obj_flags
934933
# define rb_gc_impl_pointer_to_heap_p rb_gc_functions.pointer_to_heap_p
935934
# define rb_gc_impl_garbage_object_p rb_gc_functions.garbage_object_p
936935
# define rb_gc_impl_set_event_hook rb_gc_functions.set_event_hook
937936
# define rb_gc_impl_copy_attributes rb_gc_functions.copy_attributes
938-
// GC Identification
939-
# define rb_gc_impl_active_gc_name rb_gc_functions.active_gc_name
940937
#endif
941938

942939
static VALUE initial_stress = Qfalse;

gc/gc_impl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ GC_IMPL_FN size_t rb_gc_impl_gc_count(void *objspace_ptr);
106106
GC_IMPL_FN VALUE rb_gc_impl_latest_gc_info(void *objspace_ptr, VALUE key);
107107
GC_IMPL_FN VALUE rb_gc_impl_stat(void *objspace_ptr, VALUE hash_or_sym);
108108
GC_IMPL_FN VALUE rb_gc_impl_stat_heap(void *objspace_ptr, VALUE heap_name, VALUE hash_or_sym);
109+
GC_IMPL_FN const char *rb_gc_impl_active_gc_name(void);
109110
// Miscellaneous
110111
GC_IMPL_FN size_t rb_gc_impl_obj_flags(void *objspace_ptr, VALUE obj, ID* flags, size_t max);
111112
GC_IMPL_FN bool rb_gc_impl_pointer_to_heap_p(void *objspace_ptr, const void *ptr);

internal/gc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ void *ruby_sized_xrealloc(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR
251251
void *ruby_sized_xrealloc2(void *ptr, size_t new_count, size_t element_size, size_t old_count) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2, 3));
252252
void ruby_sized_xfree(void *x, size_t size);
253253

254-
const char * rb_gc_active_gc_name(void);
254+
const char *rb_gc_active_gc_name(void);
255255
int rb_gc_modular_gc_loaded_p(void);
256256

257257
#if USE_MODULAR_GC

0 commit comments

Comments
 (0)