summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index 7096671e45..c98988efe1 100644
--- a/vm.c
+++ b/vm.c
@@ -2960,6 +2960,10 @@ rb_vm_mark(void *ptr)
rb_gc_mark(rb_ractor_self(r));
}
+ for (struct global_object_list *list = vm->gloabl_object_list; list; list = list->next) {
+ rb_gc_mark_maybe(*list->varptr);
+ }
+
rb_gc_mark_movable(vm->mark_object_ary);
rb_gc_mark_movable(vm->load_path);
rb_gc_mark_movable(vm->load_path_snapshot);
@@ -3101,6 +3105,13 @@ ruby_vm_destruct(rb_vm_t *vm)
vm->frozen_strings = 0;
}
RB_ALTSTACK_FREE(vm->main_altstack);
+
+ struct global_object_list *next;
+ for (struct global_object_list *list = vm->gloabl_object_list; list; list = next) {
+ next = list->next;
+ xfree(list);
+ }
+
if (objspace) {
if (rb_free_at_exit) {
rb_objspace_free_objects(objspace);