summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2025-03-23 13:47:56 -0400
committerPeter Zhu <[email protected]>2025-03-24 08:49:30 -0400
commita572ec1ba0830ce812e8359aec20835bcbb209be (patch)
tree014986a1a72df64d6e1811282dd98703d38b83bf
parent56b89d31c722f31164174ea5eb3aa5ec12754d73 (diff)
Move rb_gc_impl_objspace_free to shutdown section
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12965
-rw-r--r--gc.c6
-rw-r--r--gc/gc_impl.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/gc.c b/gc.c
index 6510231ccf..d3c5bf3c07 100644
--- a/gc.c
+++ b/gc.c
@@ -609,7 +609,6 @@ typedef struct gc_function_map {
// Bootup
void *(*objspace_alloc)(void);
void (*objspace_init)(void *objspace_ptr);
- void (*objspace_free)(void *objspace_ptr);
void *(*ractor_cache_alloc)(void *objspace_ptr, void *ractor);
void (*ractor_cache_free)(void *objspace_ptr, void *cache);
void (*set_params)(void *objspace_ptr);
@@ -617,6 +616,7 @@ typedef struct gc_function_map {
size_t *(*heap_sizes)(void *objspace_ptr);
// Shutdown
void (*shutdown_free_objects)(void *objspace_ptr);
+ void (*objspace_free)(void *objspace_ptr);
// GC
void (*start)(void *objspace_ptr, bool full_mark, bool immediate_mark, bool immediate_sweep, bool compact);
bool (*during_gc_p)(void *objspace_ptr);
@@ -786,7 +786,6 @@ ruby_modular_gc_init(void)
// Bootup
load_modular_gc_func(objspace_alloc);
load_modular_gc_func(objspace_init);
- load_modular_gc_func(objspace_free);
load_modular_gc_func(ractor_cache_alloc);
load_modular_gc_func(ractor_cache_free);
load_modular_gc_func(set_params);
@@ -794,6 +793,7 @@ ruby_modular_gc_init(void)
load_modular_gc_func(heap_sizes);
// Shutdown
load_modular_gc_func(shutdown_free_objects);
+ load_modular_gc_func(objspace_free);
// GC
load_modular_gc_func(start);
load_modular_gc_func(during_gc_p);
@@ -869,7 +869,6 @@ ruby_modular_gc_init(void)
// Bootup
# define rb_gc_impl_objspace_alloc rb_gc_functions.objspace_alloc
# define rb_gc_impl_objspace_init rb_gc_functions.objspace_init
-# define rb_gc_impl_objspace_free rb_gc_functions.objspace_free
# define rb_gc_impl_ractor_cache_alloc rb_gc_functions.ractor_cache_alloc
# define rb_gc_impl_ractor_cache_free rb_gc_functions.ractor_cache_free
# define rb_gc_impl_set_params rb_gc_functions.set_params
@@ -877,6 +876,7 @@ ruby_modular_gc_init(void)
# define rb_gc_impl_heap_sizes rb_gc_functions.heap_sizes
// Shutdown
# define rb_gc_impl_shutdown_free_objects rb_gc_functions.shutdown_free_objects
+# define rb_gc_impl_objspace_free rb_gc_functions.objspace_free
// GC
# define rb_gc_impl_start rb_gc_functions.start
# define rb_gc_impl_during_gc_p rb_gc_functions.during_gc_p
diff --git a/gc/gc_impl.h b/gc/gc_impl.h
index 5e8d209432..ca8818b2a1 100644
--- a/gc/gc_impl.h
+++ b/gc/gc_impl.h
@@ -35,7 +35,6 @@ struct rb_gc_object_metadata_entry {
// Bootup
GC_IMPL_FN void *rb_gc_impl_objspace_alloc(void);
GC_IMPL_FN void rb_gc_impl_objspace_init(void *objspace_ptr);
-GC_IMPL_FN void rb_gc_impl_objspace_free(void *objspace_ptr);
GC_IMPL_FN void *rb_gc_impl_ractor_cache_alloc(void *objspace_ptr, void *ractor);
GC_IMPL_FN void rb_gc_impl_ractor_cache_free(void *objspace_ptr, void *cache);
GC_IMPL_FN void rb_gc_impl_set_params(void *objspace_ptr);
@@ -43,6 +42,7 @@ GC_IMPL_FN void rb_gc_impl_init(void);
GC_IMPL_FN size_t *rb_gc_impl_heap_sizes(void *objspace_ptr);
// Shutdown
GC_IMPL_FN void rb_gc_impl_shutdown_free_objects(void *objspace_ptr);
+GC_IMPL_FN void rb_gc_impl_objspace_free(void *objspace_ptr);
// GC
GC_IMPL_FN void rb_gc_impl_start(void *objspace_ptr, bool full_mark, bool immediate_mark, bool immediate_sweep, bool compact);
GC_IMPL_FN bool rb_gc_impl_during_gc_p(void *objspace_ptr);