Skip to content

Commit e24b528

Browse files
committed
Allow objects on Ruby stack to be GC movable
Objects on the Ruby stack can be GC movable and there is corresponding code in rb_execution_context_update to update references for moved objects.
1 parent 631a507 commit e24b528

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎vm.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3682,8 +3682,9 @@ rb_execution_context_mark(const rb_execution_context_t *ec)
36823682
rb_control_frame_t *cfp = ec->cfp;
36833683
rb_control_frame_t *limit_cfp = (void *)(ec->vm_stack + ec->vm_stack_size);
36843684

3685-
VM_ASSERT(sp == ec->cfp->sp);
3686-
rb_gc_mark_vm_stack_values((long)(sp - p), p);
3685+
for (long i = 0; i < (long)(sp - p); i++) {
3686+
rb_gc_mark_movable(p[i]);
3687+
}
36873688

36883689
while (cfp != limit_cfp) {
36893690
const VALUE *ep = cfp->ep;

0 commit comments

Comments
 (0)