diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | gc.c | 19 |
2 files changed, 23 insertions, 0 deletions
@@ -1,3 +1,7 @@ +Wed Nov 6 07:13:18 2013 Koichi Sasada <ko1@atdot.net> + + * gc.c (Init_GC): add GC::OPTS to show options. + Wed Nov 6 07:12:17 2013 Koichi Sasada <ko1@atdot.net> * benchmark/gc/gcbench.rb: add some options to make quiet. @@ -6827,4 +6827,23 @@ Init_GC(void) rb_define_singleton_method(rb_mGC, "malloc_allocated_size", gc_malloc_allocated_size, 0); rb_define_singleton_method(rb_mGC, "malloc_allocations", gc_malloc_allocations, 0); #endif + + /* ::GC::OPTS, which shows GC build options */ + { + VALUE opts; + rb_define_const(rb_mGC, "OPTS", opts = rb_ary_new()); +#define OPT(o) if (o) rb_ary_push(opts, rb_str_new2(#o)) + OPT(GC_DEBUG); + OPT(USE_RGENGC); + OPT(RGENGC_DEBUG); + OPT(RGENGC_CHECK_MODE); + OPT(RGENGC_PROFILE); + OPT(RGENGC_THREEGEN); + OPT(RGENGC_ESTIMATE_OLDSPACE); + OPT(GC_PROFILE_MORE_DETAIL); + OPT(GC_ENABLE_LAZY_SWEEP); + OPT(CALC_EXACT_MALLOC_SIZE); + OPT(CALC_EXACT_MALLOC_SIZE_CHECK_OLD_SIZE); +#undef OPT + } } |