diff options
author | Koichi Sasada <ko1@atdot.net> | 2019-09-25 16:55:54 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2019-09-25 17:01:54 +0900 |
commit | 3deeb3fd914bc5604e84e7a41ec2b5193a560479 (patch) | |
tree | 4506f86ac7876acbacbb4e9aca3fb6d939054c1e /array.c | |
parent | 112c9f1430ce495e76aef73221578adc9b240a3b (diff) | |
download | ruby-3deeb3fd914bc5604e84e7a41ec2b5193a560479.tar.gz |
introduce `obj_ary_extracapa`.
Introduce a new debug counter `obj_ary_extracapa` which counts
arrays which are `len < capa`.
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -786,6 +786,8 @@ void rb_ary_free(VALUE ary) { if (ARY_OWNS_HEAP_P(ary)) { + (void)RB_DEBUG_COUNTER_INC_IF(obj_ary_extracapa, ARY_HEAP_CAPA(ary) > RARRAY_LEN(ary)); + if (RARRAY_TRANSIENT_P(ary)) { RB_DEBUG_COUNTER_INC(obj_ary_transient); } |