[前][次][番号順一覧][スレッド一覧]

ruby-changes:56995

From: Nobuyoshi <ko1@a...>
Date: Tue, 13 Aug 2019 11:20:42 +0900 (JST)
Subject: [ruby-changes:56995] Nobuyoshi Nakada: 0c1c42c43a (master): Move rb_objspace_t* in objspace_reachable_objects_from_root to an argument

https://git.ruby-lang.org/ruby.git/commit/?id=0c1c42c43a

From 0c1c42c43a8609e212db9ef64e43d5ca04101694 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 13 Aug 2019 10:33:19 +0900
Subject: Move rb_objspace_t* in objspace_reachable_objects_from_root to an
 argument


diff --git a/gc.c b/gc.c
index 77d6e5b..cdb4736 100644
--- a/gc.c
+++ b/gc.c
@@ -2729,6 +2729,8 @@ Init_gc_stress(void) https://github.com/ruby/ruby/blob/trunk/gc.c#L2729
 
 typedef int each_obj_callback(void *, void *, size_t, void *);
 
+static void objspace_reachable_objects_from_root(rb_objspace_t *, void (func)(const char *, VALUE, void *), void *);
+
 struct each_obj_args {
     each_obj_callback *callback;
     void *data;
@@ -8337,9 +8339,9 @@ heap_check_moved_i(void *vstart, void *vend, size_t stride, void *data) https://github.com/ruby/ruby/blob/trunk/gc.c#L8339
 }
 
 static VALUE
-gc_check_references_for_moved(VALUE dummy)
+gc_check_references_for_moved(rb_objspace_t *objspace)
 {
-    rb_objspace_reachable_objects_from_root(root_obj_check_moved_i, NULL);
+    objspace_reachable_objects_from_root(objspace, root_obj_check_moved_i, NULL);
     rb_objspace_each_objects(heap_check_moved_i, NULL);
     return Qnil;
 }
@@ -8375,7 +8377,7 @@ gc_compact_after_gc(rb_objspace_t *objspace, int use_toward_empty, int use_doubl https://github.com/ruby/ruby/blob/trunk/gc.c#L8377
     if (!RTEST(disabled)) rb_gc_enable();
 
     if (use_verifier) {
-        gc_check_references_for_moved(Qnil);
+        gc_check_references_for_moved(objspace);
     }
 
     rb_clear_method_cache_by_class(rb_cObject);
@@ -9369,6 +9371,12 @@ void https://github.com/ruby/ruby/blob/trunk/gc.c#L9371
 rb_objspace_reachable_objects_from_root(void (func)(const char *category, VALUE, void *), void *passing_data)
 {
     rb_objspace_t *objspace = &rb_objspace;
+    objspace_reachable_objects_from_root(objspace, func, passing_data);
+}
+
+static void
+objspace_reachable_objects_from_root(rb_objspace_t *objspace, void (func)(const char *category, VALUE, void *), void *passing_data)
+{
     struct root_objects_data data;
     struct mark_func_data_struct mfd;
 
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]