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

ruby-changes:32156

From: ko1 <ko1@a...>
Date: Mon, 16 Dec 2013 18:02:00 +0900 (JST)
Subject: [ruby-changes:32156] ko1:r44235 (trunk): * gc.c (rb_objspace_each_objects): should not clear dont_lazy_sweep

ko1	2013-12-16 18:01:49 +0900 (Mon, 16 Dec 2013)

  New Revision: 44235

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

  Log:
    * gc.c (rb_objspace_each_objects): should not clear dont_lazy_sweep
      flag in nested case.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 44234)
+++ ChangeLog	(revision 44235)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Dec 16 18:00:51 2013  Koichi Sasada  <ko1@a...>
+
+	* gc.c (rb_objspace_each_objects): should not clear dont_lazy_sweep
+	  flag in nested case.
+
 Mon Dec 16 16:40:35 2013  Koichi Sasada  <ko1@a...>
 
 	* vm_method.c (rb_method_entry_make): fix WB miss.
Index: gc.c
===================================================================
--- gc.c	(revision 44234)
+++ gc.c	(revision 44235)
@@ -1748,13 +1748,20 @@ rb_objspace_each_objects(each_obj_callba https://github.com/ruby/ruby/blob/trunk/gc.c#L1748
 {
     struct each_obj_args args;
     rb_objspace_t *objspace = &rb_objspace;
+    int prev_dont_lazy_sweep = objspace->flags.dont_lazy_sweep;
 
     gc_rest_sweep(objspace);
     objspace->flags.dont_lazy_sweep = TRUE;
 
     args.callback = callback;
     args.data = data;
-    rb_ensure(objspace_each_objects, (VALUE)&args, lazy_sweep_enable, Qnil);
+
+    if (prev_dont_lazy_sweep) {
+	objspace_each_objects((VALUE)&args);
+    }
+    else {
+	rb_ensure(objspace_each_objects, (VALUE)&args, lazy_sweep_enable, Qnil);
+    }
 }
 
 struct os_each_struct {

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

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