diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-06-16 23:43:22 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-06-17 10:47:16 +0900 |
commit | 2c190863239bee3f54cfb74b16bb6ea4cae6ed20 (patch) | |
tree | 2a8444768410a167bc0a1cb0a1309eb60852a25b /gc.c | |
parent | e46292197fd917d0a450c30e8341c1872e6aab19 (diff) | |
download | ruby-2c190863239bee3f54cfb74b16bb6ea4cae6ed20.tar.gz |
Suppress code unused unless GC_CAN_COMPILE_COMPACTION
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -9740,6 +9740,7 @@ gc_move(rb_objspace_t *objspace, VALUE scan, VALUE free, size_t src_slot_size, s 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) 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) 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) 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) 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 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 _) 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) 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 _) { 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) |