summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-20 20:39:20 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-20 20:39:20 +0000
commitd1c518d416274a8142cb8281f3361e91f98cc5f4 (patch)
tree30268790cf0868754c89036a28b95fd70d2d9eae /gc.c
parent8c96736565505094bdb29b8cfbd107754d8918d6 (diff)
* gc.c (gc_prof_sweep_timer_stop): accumulate sweep time only when
record->gc_time > 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gc.c b/gc.c
index 4528318fb4..44326d53e7 100644
--- a/gc.c
+++ b/gc.c
@@ -5086,13 +5086,17 @@ gc_prof_sweep_timer_stop(rb_objspace_t *objspace)
}
if (objspace->profile.run) {
double sweep_time;
+
gc_profile_record *record = gc_prof_record(objspace);
- if (record->gc_time > 0 || GC_PROFILE_MORE_DETAIL) {
- /* need to accumulate for lazy sweep */
+ if (record->gc_time > 0) {
sweep_time = elapsed_time_from(objspace->profile.gc_sweep_start_time);
+ /* need to accumulate GC time for lazy sweep after gc() */
record->gc_time += sweep_time;
}
+ else if (GC_PROFILE_MORE_DETAIL) {
+ sweep_time = elapsed_time_from(objspace->profile.gc_sweep_start_time);
+ }
#if GC_PROFILE_MORE_DETAIL
record->gc_sweep_time += sweep_time;