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

ruby-changes:28834

From: ko1 <ko1@a...>
Date: Wed, 22 May 2013 14:21:17 +0900 (JST)
Subject: [ruby-changes:28834] ko1:r40886 (trunk): * gc.c (gc_prepare_free_objects, rest_sweep, lazy_sweep): fix position

ko1	2013-05-22 14:21:06 +0900 (Wed, 22 May 2013)

  New Revision: 40886

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

  Log:
    * gc.c (gc_prepare_free_objects, rest_sweep, lazy_sweep): fix position
      of `during_gc' setting.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40885)
+++ ChangeLog	(revision 40886)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed May 22 14:19:56 2013  Koichi Sasada  <ko1@a...>
+
+	* gc.c (gc_prepare_free_objects, rest_sweep, lazy_sweep): fix position
+	  of `during_gc' setting.
+
 Wed May 22 07:36:08 2013  Koichi Sasada  <ko1@a...>
 
 	* gc.c (garbage_collect): all GC is start from garbage_collect()
Index: gc.c
===================================================================
--- gc.c	(revision 40885)
+++ gc.c	(revision 40886)
@@ -534,6 +534,7 @@ void https://github.com/ruby/ruby/blob/trunk/gc.c#L534
 rb_objspace_free(rb_objspace_t *objspace)
 {
     rest_sweep(objspace);
+
     if (objspace->profile.record) {
 	free(objspace->profile.record);
 	objspace->profile.record = 0;
@@ -2275,7 +2276,6 @@ lazy_sweep(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L2276
 	if (!next) after_gc_sweep(objspace);
 
         if (has_free_object) {
-            during_gc = 0;
             return TRUE;
         }
     }
@@ -2286,9 +2286,11 @@ static void https://github.com/ruby/ruby/blob/trunk/gc.c#L2286
 rest_sweep(rb_objspace_t *objspace)
 {
     if (objspace->heap.sweep_slots) {
+	during_gc++;
 	while (objspace->heap.sweep_slots) {
 	    lazy_sweep(objspace);
 	}
+	during_gc = 0;
     }
 }
 
@@ -2341,6 +2343,7 @@ gc_prepare_free_objects(rb_objspace_t *o https://github.com/ruby/ruby/blob/trunk/gc.c#L2343
 
     if (objspace->heap.sweep_slots) {
 	if (lazy_sweep(objspace)) {
+	    during_gc = 0;
 	    return TRUE;
 	}
     }

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

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