ruby-changes:59405
From: Koichi <ko1@a...>
Date: Mon, 23 Dec 2019 16:32:09 +0900 (JST)
Subject: [ruby-changes:59405] 9eeaae432b (master): add more debug counters to count numeric objects.
https://git.ruby-lang.org/ruby.git/commit/?id=9eeaae432b From 9eeaae432b9a894e28e3906435f3d454d8fd025c Mon Sep 17 00:00:00 2001 From: Koichi Sasada <ko1@a...> Date: Mon, 23 Dec 2019 16:30:45 +0900 Subject: add more debug counters to count numeric objects. diff --git a/debug_counter.h b/debug_counter.h index ee00d9d..b9515f4 100644 --- a/debug_counter.h +++ b/debug_counter.h @@ -247,8 +247,6 @@ RB_DEBUG_COUNTER(obj_struct_embed) https://github.com/ruby/ruby/blob/trunk/debug_counter.h#L247 RB_DEBUG_COUNTER(obj_struct_transient) RB_DEBUG_COUNTER(obj_struct_ptr) -RB_DEBUG_COUNTER(obj_regexp_ptr) - RB_DEBUG_COUNTER(obj_data_empty) RB_DEBUG_COUNTER(obj_data_xfree) RB_DEBUG_COUNTER(obj_data_imm_free) @@ -258,9 +256,19 @@ RB_DEBUG_COUNTER(obj_match_under4) https://github.com/ruby/ruby/blob/trunk/debug_counter.h#L256 RB_DEBUG_COUNTER(obj_match_ge4) RB_DEBUG_COUNTER(obj_match_ge8) RB_DEBUG_COUNTER(obj_match_ptr) -RB_DEBUG_COUNTER(obj_file_ptr) + +RB_DEBUG_COUNTER(obj_iclass_ptr) +RB_DEBUG_COUNTER(obj_class_ptr) +RB_DEBUG_COUNTER(obj_module_ptr) + RB_DEBUG_COUNTER(obj_bignum_ptr) +RB_DEBUG_COUNTER(obj_bignum_embed) +RB_DEBUG_COUNTER(obj_float) +RB_DEBUG_COUNTER(obj_complex) +RB_DEBUG_COUNTER(obj_rational) +RB_DEBUG_COUNTER(obj_regexp_ptr) +RB_DEBUG_COUNTER(obj_file_ptr) RB_DEBUG_COUNTER(obj_symbol) RB_DEBUG_COUNTER(obj_imemo_ment) @@ -275,10 +283,6 @@ RB_DEBUG_COUNTER(obj_imemo_ifunc) https://github.com/ruby/ruby/blob/trunk/debug_counter.h#L283 RB_DEBUG_COUNTER(obj_imemo_memo) RB_DEBUG_COUNTER(obj_imemo_parser_strterm) -RB_DEBUG_COUNTER(obj_iclass_ptr) -RB_DEBUG_COUNTER(obj_class_ptr) -RB_DEBUG_COUNTER(obj_module_ptr) - /* ar_table */ RB_DEBUG_COUNTER(artable_hint_hit) RB_DEBUG_COUNTER(artable_hint_miss) diff --git a/gc.c b/gc.c index f6e75e8..728aea9 100644 --- a/gc.c +++ b/gc.c @@ -2750,7 +2750,11 @@ obj_free(rb_objspace_t *objspace, VALUE obj) https://github.com/ruby/ruby/blob/trunk/gc.c#L2750 } break; case T_RATIONAL: + RB_DEBUG_COUNTER_INC(obj_rational); + break; case T_COMPLEX: + RB_DEBUG_COUNTER_INC(obj_complex); + break; case T_MOVED: break; case T_ICLASS: @@ -2774,6 +2778,7 @@ obj_free(rb_objspace_t *objspace, VALUE obj) https://github.com/ruby/ruby/blob/trunk/gc.c#L2778 break; case T_FLOAT: + RB_DEBUG_COUNTER_INC(obj_float); break; case T_BIGNUM: @@ -2781,6 +2786,9 @@ obj_free(rb_objspace_t *objspace, VALUE obj) https://github.com/ruby/ruby/blob/trunk/gc.c#L2786 xfree(BIGNUM_DIGITS(obj)); RB_DEBUG_COUNTER_INC(obj_bignum_ptr); } + else { + RB_DEBUG_COUNTER_INC(obj_bignum_embed); + } break; case T_NODE: -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/