[前][次][番号順一覧][スレッド一覧]

ruby-changes:72202

From: Nobuyoshi <ko1@a...>
Date: Fri, 17 Jun 2022 10:51:22 +0900 (JST)
Subject: [ruby-changes:72202] 2c19086323 (master): Suppress code unused unless GC_CAN_COMPILE_COMPACTION

https://git.ruby-lang.org/ruby.git/commit/?id=2c19086323

From 2c190863239bee3f54cfb74b16bb6ea4cae6ed20 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Thu, 16 Jun 2022 23:43:22 +0900
Subject: Suppress code unused unless GC_CAN_COMPILE_COMPACTION

---
 gc.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gc.c b/gc.c
index 4aa7d18401..0ccba2e433 100644
--- a/gc.c
+++ b/gc.c
@@ -9740,6 +9740,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#L9740
     return (VALUE)src;
 }
 
+#if GC_CAN_COMPILE_COMPACTION
 static int
 compare_free_slots(const void *left, const void *right, void *dummy)
 {
@@ -9788,6 +9789,7 @@ gc_sort_heap_by_empty_slots(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L9789
         free(page_list);
     }
 }
+#endif
 
 static void
 gc_ref_update_array(rb_objspace_t * objspace, VALUE v)
@@ -10487,6 +10489,7 @@ gc_update_references(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L10489
     gc_update_table_refs(objspace, finalizer_table);
 }
 
+#if GC_CAN_COMPILE_COMPACTION
 /*
  *  call-seq:
  *     GC.latest_compact_info -> {:considered=>{:T_CLASS=>11}, :moved=>{:T_CLASS=>11}}
@@ -10535,7 +10538,11 @@ gc_compact_stats(VALUE self) https://github.com/ruby/ruby/blob/trunk/gc.c#L10538
 
     return h;
 }
+#else
+#  define gc_compact_stats rb_f_notimplement
+#endif
 
+#if GC_CAN_COMPILE_COMPACTION
 static void
 root_obj_check_moved_i(const char *category, VALUE obj, void *data)
 {
@@ -10610,7 +10617,11 @@ gc_compact(VALUE self) https://github.com/ruby/ruby/blob/trunk/gc.c#L10617
 
     return gc_compact_stats(self);
 }
+#else
+#  define gc_compact rb_f_notimplement
+#endif
 
+#if GC_CAN_COMPILE_COMPACTION
 static VALUE
 gc_verify_compaction_references(rb_execution_context_t *ec, VALUE self, VALUE double_heap, VALUE toward_empty)
 {
@@ -10644,6 +10655,9 @@ gc_verify_compaction_references(rb_execution_context_t *ec, VALUE self, VALUE do https://github.com/ruby/ruby/blob/trunk/gc.c#L10655
 
     return gc_compact_stats(self);
 }
+#else
+#  define gc_verify_compaction_references (rb_builtin_arity2_function_type)rb_f_notimplement
+#endif
 
 VALUE
 rb_gc_start(void)
@@ -11234,6 +11248,7 @@ gc_disable(rb_execution_context_t *ec, VALUE _) https://github.com/ruby/ruby/blob/trunk/gc.c#L11248
     return rb_gc_disable();
 }
 
+#if GC_CAN_COMPILE_COMPACTION
 /*
  *  call-seq:
  *     GC.auto_compact = flag
@@ -11252,7 +11267,11 @@ gc_set_auto_compact(VALUE _, VALUE v) https://github.com/ruby/ruby/blob/trunk/gc.c#L11267
     ruby_enable_autocompact = RTEST(v);
     return v;
 }
+#else
+#  define gc_set_auto_compact rb_f_notimplement
+#endif
 
+#if GC_CAN_COMPILE_COMPACTION
 /*
  *  call-seq:
  *     GC.auto_compact    -> true or false
@@ -11264,6 +11283,9 @@ gc_get_auto_compact(VALUE _) https://github.com/ruby/ruby/blob/trunk/gc.c#L11283
 {
     return RBOOL(ruby_enable_autocompact);
 }
+#else
+#  define gc_get_auto_compact rb_f_notimplement
+#endif
 
 static int
 get_envparam_size(const char *name, size_t *default_value, size_t lower_bound)
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]