зеркало из https://github.com/github/ruby.git
Avoid unnecessary writes to imemo_env during GC
Similar to the previous commit, to avoid unnecessary Copy-on-Write memory use we should only set this flag when it has not previously been set.
This commit is contained in:
Родитель
f4258aaed0
Коммит
dedf5b0480
4
gc.c
4
gc.c
|
@ -7228,7 +7228,9 @@ gc_mark_imemo(rb_objspace_t *objspace, VALUE obj)
|
|||
GC_ASSERT(env->ep[VM_ENV_DATA_INDEX_ENV] == obj);
|
||||
GC_ASSERT(VM_ENV_ESCAPED_P(env->ep));
|
||||
rb_gc_mark_values((long)env->env_size, env->env);
|
||||
VM_ENV_FLAGS_SET(env->ep, VM_ENV_FLAG_WB_REQUIRED);
|
||||
if (!VM_ENV_FLAGS(env->ep, VM_ENV_FLAG_WB_REQUIRED)) {
|
||||
VM_ENV_FLAGS_SET(env->ep, VM_ENV_FLAG_WB_REQUIRED);
|
||||
}
|
||||
gc_mark(objspace, (VALUE)rb_vm_env_prev_env(env));
|
||||
gc_mark(objspace, (VALUE)env->iseq);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче