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:
parent
9d6b8806a4
commit
520ab22725
4
imemo.c
4
imemo.c
@ -357,7 +357,9 @@ rb_imemo_mark_and_move(VALUE obj, bool reference_updating)
|
||||
((VALUE *)env->ep)[VM_ENV_DATA_INDEX_ENV] = rb_gc_location(env->ep[VM_ENV_DATA_INDEX_ENV]);
|
||||
}
|
||||
else {
|
||||
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);
|
||||
}
|
||||
rb_gc_mark_movable( (VALUE)rb_vm_env_prev_env(env));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user