summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-26 04:31:10 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-26 04:31:10 +0000
commitd03912898e8fd37ad9ad82a9e6765fe8f1d78536 (patch)
tree132a8055ed81af8482ecf8ca1f83a5f3c606127c /gc.c
parentfdf7b4586fe91756b9a8b6ed1bf5d9b37c1aab6d (diff)
* gc.c (gc_sweep, gc_heap_lazy_sweep): fix measurement code.
We only need one sweep time measurement without lazy sweep. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gc.c b/gc.c
index 9aa136f4e8..d8bb7e5ca2 100644
--- a/gc.c
+++ b/gc.c
@@ -2601,7 +2601,9 @@ gc_heap_lazy_sweep(rb_objspace_t *objspace, rb_heap_t *heap)
if (page == NULL) return FALSE;
+#if GC_ENABLE_LAZY_SWEEP
gc_prof_sweep_timer_start(objspace);
+#endif
while (page) {
heap->sweep_pages = next = page->next;
@@ -2618,7 +2620,9 @@ gc_heap_lazy_sweep(rb_objspace_t *objspace, rb_heap_t *heap)
page = next;
}
+#if GC_ENABLE_LAZY_SWEEP
gc_prof_sweep_timer_stop(objspace);
+#endif
return result;
}
@@ -2646,12 +2650,14 @@ static void
gc_sweep(rb_objspace_t *objspace, int immediate_sweep)
{
if (immediate_sweep) {
+#if !GC_ENABLE_LAZY_SWEEP
gc_prof_sweep_timer_start(objspace);
+#endif
gc_before_sweep(objspace);
-
gc_heap_rest_sweep(objspace, heap_eden);
-
+#if !GC_ENABLE_LAZY_SWEEP
gc_prof_sweep_timer_stop(objspace);
+#endif
}
else {
gc_before_sweep(objspace);