mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
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
1 changed files with 3 additions and 1 deletions
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…
Add table
Add a link
Reference in a new issue