mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
Box: mark/move Box object referred via ENV/rb_env_t
This commit is contained in:
parent
0654bcd4f8
commit
e84b91a292
Notes:
git
2025-11-26 01:11:18 +00:00
7
imemo.c
7
imemo.c
@ -426,6 +426,13 @@ rb_imemo_mark_and_move(VALUE obj, bool reference_updating)
|
||||
|
||||
rb_gc_mark_and_move_ptr(&env->iseq);
|
||||
|
||||
if (VM_ENV_LOCAL_P(env->ep) && VM_ENV_BOXED_P(env->ep)) {
|
||||
const rb_box_t *box = VM_ENV_BOX(env->ep);
|
||||
if (BOX_USER_P(box)) {
|
||||
rb_gc_mark_and_move((VALUE *)&box->box_object);
|
||||
}
|
||||
}
|
||||
|
||||
if (reference_updating) {
|
||||
((VALUE *)env->ep)[VM_ENV_DATA_INDEX_ENV] = rb_gc_location(env->ep[VM_ENV_DATA_INDEX_ENV]);
|
||||
}
|
||||
|
||||
7
vm.c
7
vm.c
@ -3677,6 +3677,13 @@ rb_execution_context_mark(const rb_execution_context_t *ec)
|
||||
rb_gc_mark_movable((VALUE)cfp->iseq);
|
||||
rb_gc_mark_movable((VALUE)cfp->block_code);
|
||||
|
||||
if (VM_ENV_LOCAL_P(ep) && VM_ENV_BOXED_P(ep)) {
|
||||
const rb_box_t *box = VM_ENV_BOX(ep);
|
||||
if (BOX_USER_P(box)) {
|
||||
rb_gc_mark_movable(box->box_object);
|
||||
}
|
||||
}
|
||||
|
||||
if (!VM_ENV_LOCAL_P(ep)) {
|
||||
const VALUE *prev_ep = VM_ENV_PREV_EP(ep);
|
||||
if (VM_ENV_FLAGS(prev_ep, VM_ENV_FLAG_ESCAPED)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user