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

ruby-changes:28872

From: ko1 <ko1@a...>
Date: Sat, 25 May 2013 17:11:18 +0900 (JST)
Subject: [ruby-changes:28872] ko1:r40924 (trunk): * gc.c (after_gc_sweep): reduce full GC timing.

ko1	2013-05-25 17:11:04 +0900 (Sat, 25 May 2013)

  New Revision: 40924

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

  Log:
    * gc.c (after_gc_sweep): reduce full GC timing.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40923)
+++ ChangeLog	(revision 40924)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat May 25 17:06:25 2013  Koichi Sasada  <ko1@a...>
+
+	* gc.c (after_gc_sweep): reduce full GC timing.
+
 Sat May 25 11:28:49 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* variable.c (set_const_visibility): return without clearing method
Index: gc.c
===================================================================
--- gc.c	(revision 40923)
+++ gc.c	(revision 40924)
@@ -2252,13 +2252,13 @@ after_gc_sweep(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L2252
 		  objspace->heap.free_num, objspace->heap.free_min);
 
     if (objspace->heap.free_num < objspace->heap.free_min) {
-	if (objspace->rgengc.remembered_shady_object_count + objspace->rgengc.oldgen_object_count > (heaps_used * HEAP_OBJ_LIMIT) / 2) {
+	set_heaps_increment(objspace);
+	heaps_increment(objspace);
+
+	if (objspace->rgengc.remembered_shady_object_count + objspace->rgengc.oldgen_object_count > (heaps_length * HEAP_OBJ_LIMIT) / 2) {
 	    /* if [oldgen]+[remembered shady] > [all object count]/2, then do major GC */
 	    objspace->rgengc.need_major_gc = TRUE;
 	}
-
-	set_heaps_increment(objspace);
-	heaps_increment(objspace);
     }
 
     inc = ATOMIC_SIZE_EXCHANGE(malloc_increase, 0);

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

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