summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-25 08:11:04 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-25 08:11:04 +0000
commit7b5a42f0fa54dbb0d381ffbe3b8de6601577c518 (patch)
tree14b2deb17b09250b36baded6cf52891af218bef4
parent675ba20cea54714b90b20ba2e465b92e29ba8360 (diff)
* gc.c (after_gc_sweep): reduce full GC timing.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--gc.c8
2 files changed, 8 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 7b39e5b478..de2d975d2e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sat May 25 17:06:25 2013 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (after_gc_sweep): reduce full GC timing.
+
Sat May 25 11:28:49 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* variable.c (set_const_visibility): return without clearing method
diff --git a/gc.c b/gc.c
index 9931b5bb2d..d9f008de25 100644
--- a/gc.c
+++ b/gc.c
@@ -2252,13 +2252,13 @@ after_gc_sweep(rb_objspace_t *objspace)
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);