ruby-changes:72191
From: Peter <ko1@a...>
Date: Thu, 16 Jun 2022 23:19:05 +0900 (JST)
Subject: [ruby-changes:72191] 52d42e7023 (master): Rename GC_COMPACTION_SUPPORTED
https://git.ruby-lang.org/ruby.git/commit/?id=52d42e7023 From 52d42e702375446746164a0251e1a10bce813b78 Mon Sep 17 00:00:00 2001 From: Peter Zhu <peter@p...> Date: Tue, 14 Jun 2022 14:37:21 -0400 Subject: Rename GC_COMPACTION_SUPPORTED Naming this macro GC_COMPACTION_SUPPORTED is misleading because it only checks whether compaction is supported at compile time. [Bug #18829] --- gc.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/gc.c b/gc.c index 106f7bb2b3..0f1c801613 100644 --- a/gc.c +++ b/gc.c @@ -5184,15 +5184,15 @@ gc_unprotect_pages(rb_objspace_t *objspace, rb_heap_t *heap) https://github.com/ruby/ruby/blob/trunk/gc.c#L5184 static void gc_update_references(rb_objspace_t * objspace); static void invalidate_moved_page(rb_objspace_t *objspace, struct heap_page *page); -#ifndef GC_COMPACTION_SUPPORTED +#ifndef GC_CAN_COMPILE_COMPACTION #if defined(__wasi__) /* WebAssembly doesn't support signals */ -# define GC_COMPACTION_SUPPORTED 0 +# define GC_CAN_COMPILE_COMPACTION 0 #else -# define GC_COMPACTION_SUPPORTED 1 +# define GC_CAN_COMPILE_COMPACTION 1 #endif #endif -#if GC_COMPACTION_SUPPORTED +#if GC_CAN_COMPILE_COMPACTION static void read_barrier_handler(uintptr_t address) { @@ -5215,7 +5215,7 @@ read_barrier_handler(uintptr_t address) https://github.com/ruby/ruby/blob/trunk/gc.c#L5215 } #endif -#if !GC_COMPACTION_SUPPORTED +#if !GC_CAN_COMPILE_COMPACTION static void uninstall_handlers(void) { @@ -9575,7 +9575,7 @@ gc_start_internal(rb_execution_context_t *ec, VALUE self, VALUE full_mark, VALUE https://github.com/ruby/ruby/blob/trunk/gc.c#L9575 } #endif -#if !GC_COMPACTION_SUPPORTED +#if !GC_CAN_COMPILE_COMPACTION rb_raise(rb_eNotImpError, "Compaction isn't available on this platform"); #endif @@ -9742,7 +9742,7 @@ gc_move(rb_objspace_t *objspace, VALUE scan, VALUE free, size_t src_slot_size, s https://github.com/ruby/ruby/blob/trunk/gc.c#L9742 return (VALUE)src; } -#if GC_COMPACTION_SUPPORTED +#if GC_CAN_COMPILE_COMPACTION static int compare_free_slots(const void *left, const void *right, void *dummy) { @@ -10491,7 +10491,7 @@ gc_update_references(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L10491 gc_update_table_refs(objspace, finalizer_table); } -#if GC_COMPACTION_SUPPORTED +#if GC_CAN_COMPILE_COMPACTION /* * call-seq: * GC.latest_compact_info -> {:considered=>{:T_CLASS=>11}, :moved=>{:T_CLASS=>11}} @@ -10544,7 +10544,7 @@ gc_compact_stats(VALUE self) https://github.com/ruby/ruby/blob/trunk/gc.c#L10544 # define gc_compact_stats rb_f_notimplement #endif -#if GC_COMPACTION_SUPPORTED +#if GC_CAN_COMPILE_COMPACTION static void root_obj_check_moved_i(const char *category, VALUE obj, void *data) { @@ -10623,7 +10623,7 @@ gc_compact(VALUE self) https://github.com/ruby/ruby/blob/trunk/gc.c#L10623 # define gc_compact rb_f_notimplement #endif -#if GC_COMPACTION_SUPPORTED +#if GC_CAN_COMPILE_COMPACTION static VALUE gc_verify_compaction_references(rb_execution_context_t *ec, VALUE self, VALUE double_heap, VALUE toward_empty) { @@ -11250,7 +11250,7 @@ gc_disable(rb_execution_context_t *ec, VALUE _) https://github.com/ruby/ruby/blob/trunk/gc.c#L11250 return rb_gc_disable(); } -#if GC_COMPACTION_SUPPORTED +#if GC_CAN_COMPILE_COMPACTION /* * call-seq: * GC.auto_compact = flag @@ -11279,7 +11279,7 @@ gc_set_auto_compact(VALUE _, VALUE v) https://github.com/ruby/ruby/blob/trunk/gc.c#L11279 # define gc_set_auto_compact rb_f_notimplement #endif -#if GC_COMPACTION_SUPPORTED +#if GC_CAN_COMPILE_COMPACTION /* * call-seq: * GC.auto_compact -> true or false @@ -14154,7 +14154,7 @@ Init_GC(void) https://github.com/ruby/ruby/blob/trunk/gc.c#L14154 rb_define_singleton_method(rb_mGC, "auto_compact", gc_get_auto_compact, 0); rb_define_singleton_method(rb_mGC, "auto_compact=", gc_set_auto_compact, 1); rb_define_singleton_method(rb_mGC, "latest_compact_info", gc_compact_stats, 0); -#if !GC_COMPACTION_SUPPORTED +#if !GC_CAN_COMPILE_COMPACTION rb_define_singleton_method(rb_mGC, "verify_compaction_references", rb_f_notimplement, -1); #endif @@ -14180,7 +14180,7 @@ Init_GC(void) https://github.com/ruby/ruby/blob/trunk/gc.c#L14180 OPT(MALLOC_ALLOCATED_SIZE); OPT(MALLOC_ALLOCATED_SIZE_CHECK); OPT(GC_PROFILE_DETAIL_MEMORY); - OPT(GC_COMPACTION_SUPPORTED); + OPT(GC_CAN_COMPILE_COMPACTION); #undef OPT OBJ_FREEZE(opts); } -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/