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

ruby-changes:29946

From: ko1 <ko1@a...>
Date: Tue, 16 Jul 2013 16:33:59 +0900 (JST)
Subject: [ruby-changes:29946] ko1:r41998 (trunk): * gc.c (lazy_sweep): refactoring.

ko1	2013-07-16 16:33:48 +0900 (Tue, 16 Jul 2013)

  New Revision: 41998

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

  Log:
    * gc.c (lazy_sweep): refactoring.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41997)
+++ ChangeLog	(revision 41998)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Jul 16 16:30:58 2013  Koichi Sasada  <ko1@a...>
+
+	* gc.c (lazy_sweep): refactoring.
+
 Tue Jul 16 13:32:06 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* encoding.c (enc_set_index): since r41967, old terminator is dealt
Index: gc.c
===================================================================
--- gc.c	(revision 41997)
+++ gc.c	(revision 41998)
@@ -2384,16 +2384,19 @@ after_gc_sweep(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L2384
 static int
 lazy_sweep(rb_objspace_t *objspace)
 {
-    struct heaps_slot *next;
+    struct heaps_slot *slot, *next;
     int result = FALSE;
 
     gc_prof_sweep_timer_start(objspace);
 
     heaps_increment(objspace);
-    while (is_lazy_sweeping(objspace)) {
-        next = objspace->heap.sweep_slots->next;
-	slot_sweep(objspace, objspace->heap.sweep_slots);
-        objspace->heap.sweep_slots = next;
+
+    slot = objspace->heap.sweep_slots;
+
+    while (slot) {
+	objspace->heap.sweep_slots = next = slot->next;
+
+	slot_sweep(objspace, slot);
 
 	if (!next) after_gc_sweep(objspace);
 
@@ -2401,6 +2404,8 @@ lazy_sweep(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L2404
             result = TRUE;
 	    break;
         }
+
+	slot = next;
     }
 
     gc_prof_sweep_timer_stop(objspace);

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

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