Skip to content

Commit 2c19086

Browse files
committedJun 17, 2022
Suppress code unused unless GC_CAN_COMPILE_COMPACTION
1 parent e462921 commit 2c19086

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
 

Diff for: ‎gc.c

+22
Original file line numberDiff line numberDiff line change
@@ -9740,6 +9740,7 @@ gc_move(rb_objspace_t *objspace, VALUE scan, VALUE free, size_t src_slot_size, s
97409740
return (VALUE)src;
97419741
}
97429742

9743+
#if GC_CAN_COMPILE_COMPACTION
97439744
static int
97449745
compare_free_slots(const void *left, const void *right, void *dummy)
97459746
{
@@ -9788,6 +9789,7 @@ gc_sort_heap_by_empty_slots(rb_objspace_t *objspace)
97889789
free(page_list);
97899790
}
97909791
}
9792+
#endif
97919793

97929794
static void
97939795
gc_ref_update_array(rb_objspace_t * objspace, VALUE v)
@@ -10487,6 +10489,7 @@ gc_update_references(rb_objspace_t *objspace)
1048710489
gc_update_table_refs(objspace, finalizer_table);
1048810490
}
1048910491

10492+
#if GC_CAN_COMPILE_COMPACTION
1049010493
/*
1049110494
* call-seq:
1049210495
* GC.latest_compact_info -> {:considered=>{:T_CLASS=>11}, :moved=>{:T_CLASS=>11}}
@@ -10535,7 +10538,11 @@ gc_compact_stats(VALUE self)
1053510538

1053610539
return h;
1053710540
}
10541+
#else
10542+
# define gc_compact_stats rb_f_notimplement
10543+
#endif
1053810544

10545+
#if GC_CAN_COMPILE_COMPACTION
1053910546
static void
1054010547
root_obj_check_moved_i(const char *category, VALUE obj, void *data)
1054110548
{
@@ -10610,7 +10617,11 @@ gc_compact(VALUE self)
1061010617

1061110618
return gc_compact_stats(self);
1061210619
}
10620+
#else
10621+
# define gc_compact rb_f_notimplement
10622+
#endif
1061310623

10624+
#if GC_CAN_COMPILE_COMPACTION
1061410625
static VALUE
1061510626
gc_verify_compaction_references(rb_execution_context_t *ec, VALUE self, VALUE double_heap, VALUE toward_empty)
1061610627
{
@@ -10644,6 +10655,9 @@ gc_verify_compaction_references(rb_execution_context_t *ec, VALUE self, VALUE do
1064410655

1064510656
return gc_compact_stats(self);
1064610657
}
10658+
#else
10659+
# define gc_verify_compaction_references (rb_builtin_arity2_function_type)rb_f_notimplement
10660+
#endif
1064710661

1064810662
VALUE
1064910663
rb_gc_start(void)
@@ -11234,6 +11248,7 @@ gc_disable(rb_execution_context_t *ec, VALUE _)
1123411248
return rb_gc_disable();
1123511249
}
1123611250

11251+
#if GC_CAN_COMPILE_COMPACTION
1123711252
/*
1123811253
* call-seq:
1123911254
* GC.auto_compact = flag
@@ -11252,7 +11267,11 @@ gc_set_auto_compact(VALUE _, VALUE v)
1125211267
ruby_enable_autocompact = RTEST(v);
1125311268
return v;
1125411269
}
11270+
#else
11271+
# define gc_set_auto_compact rb_f_notimplement
11272+
#endif
1125511273

11274+
#if GC_CAN_COMPILE_COMPACTION
1125611275
/*
1125711276
* call-seq:
1125811277
* GC.auto_compact -> true or false
@@ -11264,6 +11283,9 @@ gc_get_auto_compact(VALUE _)
1126411283
{
1126511284
return RBOOL(ruby_enable_autocompact);
1126611285
}
11286+
#else
11287+
# define gc_get_auto_compact rb_f_notimplement
11288+
#endif
1126711289

1126811290
static int
1126911291
get_envparam_size(const char *name, size_t *default_value, size_t lower_bound)

0 commit comments

Comments
 (0)