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

ruby-changes:25257

From: ko1 <ko1@a...>
Date: Wed, 24 Oct 2012 10:43:50 +0900 (JST)
Subject: [ruby-changes:25257] ko1:r37309 (trunk): * gc.c (garbage_collect, gc_marks): move the location of

ko1	2012-10-24 10:39:45 +0900 (Wed, 24 Oct 2012)

  New Revision: 37309

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37309

  Log:
    * gc.c (garbage_collect, gc_marks): move the location of
      clear and restore rb_objspace_t::mark_func_data
      from garbage_collect() to gc_marks().

  Modified files:
    trunk/ChangeLog
    trunk/gc.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 37308)
+++ ChangeLog	(revision 37309)
@@ -1,3 +1,9 @@
+Wed Oct 24 10:33:09 2012  Koichi Sasada  <ko1@a...>
+
+	* gc.c (garbage_collect, gc_marks): move the location of
+	  clear and restore rb_objspace_t::mark_func_data
+	  from garbage_collect() to gc_marks().
+
 Wed Oct 24 10:17:45 2012  Koichi Sasada  <ko1@a...>
 
 	* ext/objspace/objspace.c (Init_objspace): add a new method
Index: gc.c
===================================================================
--- gc.c	(revision 37308)
+++ gc.c	(revision 37309)
@@ -2914,7 +2914,11 @@
 {
     struct gc_list *list;
     rb_thread_t *th = GET_THREAD();
+    struct mark_func_data_struct *prev_mark_func_data;
 
+    prev_mark_func_data = objspace->mark_func_data;
+    objspace->mark_func_data = 0;
+
     gc_prof_mark_timer_start(objspace);
 
     objspace->heap.live_num = 0;
@@ -2951,6 +2955,8 @@
     gc_mark_stacked_objects(objspace);
 
     gc_prof_mark_timer_stop(objspace);
+
+    objspace->mark_func_data = prev_mark_func_data;
 }
 
 /* GC */
@@ -3020,8 +3026,6 @@
 static int
 garbage_collect(rb_objspace_t *objspace)
 {
-    struct mark_func_data_struct *prev_mark_func_data;
-
     if (GC_NOTIFY) printf("start garbage_collect()\n");
 
     if (!heaps) {
@@ -3033,9 +3037,6 @@
 
     gc_prof_timer_start(objspace);
 
-    prev_mark_func_data = objspace->mark_func_data;
-    objspace->mark_func_data = 0;
-
     rest_sweep(objspace);
 
     during_gc++;
@@ -3045,8 +3046,6 @@
     gc_sweep(objspace);
     gc_prof_sweep_timer_stop(objspace);
 
-    objspace->mark_func_data = prev_mark_func_data;
-
     gc_prof_timer_stop(objspace, Qtrue);
     if (GC_NOTIFY) printf("end garbage_collect()\n");
     return TRUE;

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

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