summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2020-05-07 10:07:57 -0700
committerAaron Patterson <tenderlove@ruby-lang.org>2020-05-07 11:42:39 -0700
commitff4f9cf95d73cc2730949df583bf0e41702d7aae (patch)
tree42101ad25cc3eb8d91ddc21162262812c41dc7b3 /gc.c
parent7ded8fd29a9dc5c481cadff7e94079009bce9e6c (diff)
Allow global variables to move
This patch allows global variables that have been assigned in Ruby to move. I added a new function for the GC to call that will update global references and introduced a new callback in the global variable struct for updating references. Only pure Ruby global variables are supported right now, other references will be pinned.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 67ec968bd9..ab75d6752a 100644
--- a/gc.c
+++ b/gc.c
@@ -8491,6 +8491,7 @@ gc_update_references(rb_objspace_t * objspace)
objspace_each_objects_without_setup(objspace, gc_ref_update, objspace);
rb_vm_update_references(vm);
rb_transient_heap_update_references();
+ rb_gc_update_global_tbl();
global_symbols.ids = rb_gc_location(global_symbols.ids);
global_symbols.dsymbol_fstr_hash = rb_gc_location(global_symbols.dsymbol_fstr_hash);
gc_update_tbl_refs(objspace, objspace->obj_to_id_tbl);