summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2020-05-12 12:00:35 -0700
committerAaron Patterson <tenderlove@ruby-lang.org>2020-05-18 16:57:10 -0700
commit6efb9fe04229c9e96205025bfd8b6cfec1b9a30f (patch)
tree86708733d3faba07dab1fcc10baf29bf5589c608 /gc.c
parent9ee66d2bef4a32b5b9880a5226f3fbeb7fde5884 (diff)
Allow references stored in the VM stack to move
We can update these references too, so lets allow them to move.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gc.c b/gc.c
index 76d112ca53..6353a7b50a 100644
--- a/gc.c
+++ b/gc.c
@@ -4800,14 +4800,13 @@ rb_gc_mark_values(long n, const VALUE *values)
}
static void
-gc_mark_and_pin_stack_values(rb_objspace_t *objspace, long n, const VALUE *values)
+gc_mark_stack_values(rb_objspace_t *objspace, long n, const VALUE *values)
{
long i;
for (i=0; i<n; i++) {
- /* skip MOVED objects that are on the stack */
- if (is_markable_object(objspace, values[i]) && T_MOVED != BUILTIN_TYPE(values[i])) {
- gc_mark_and_pin(objspace, values[i]);
+ if (is_markable_object(objspace, values[i])) {
+ gc_mark(objspace, values[i]);
}
}
}
@@ -4816,7 +4815,7 @@ void
rb_gc_mark_vm_stack_values(long n, const VALUE *values)
{
rb_objspace_t *objspace = &rb_objspace;
- gc_mark_and_pin_stack_values(objspace, n, values);
+ gc_mark_stack_values(objspace, n, values);
}
static int