зеркало из https://github.com/github/ruby.git
introduce `obj_ary_extracapa`.
Introduce a new debug counter `obj_ary_extracapa` which counts arrays which are `len < capa`.
This commit is contained in:
Родитель
112c9f1430
Коммит
3deeb3fd91
2
array.c
2
array.c
|
@ -786,6 +786,8 @@ void
|
||||||
rb_ary_free(VALUE ary)
|
rb_ary_free(VALUE ary)
|
||||||
{
|
{
|
||||||
if (ARY_OWNS_HEAP_P(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)) {
|
if (RARRAY_TRANSIENT_P(ary)) {
|
||||||
RB_DEBUG_COUNTER_INC(obj_ary_transient);
|
RB_DEBUG_COUNTER_INC(obj_ary_transient);
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,6 +206,7 @@ RB_DEBUG_COUNTER(obj_str_fstr)
|
||||||
RB_DEBUG_COUNTER(obj_ary_embed)
|
RB_DEBUG_COUNTER(obj_ary_embed)
|
||||||
RB_DEBUG_COUNTER(obj_ary_transient)
|
RB_DEBUG_COUNTER(obj_ary_transient)
|
||||||
RB_DEBUG_COUNTER(obj_ary_ptr)
|
RB_DEBUG_COUNTER(obj_ary_ptr)
|
||||||
|
RB_DEBUG_COUNTER(obj_ary_extracapa)
|
||||||
/*
|
/*
|
||||||
ary_shared_create: shared ary by Array#dup and so on.
|
ary_shared_create: shared ary by Array#dup and so on.
|
||||||
ary_shared: finished in shard.
|
ary_shared: finished in shard.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче