* 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
This commit is contained in:
ko1 2013-06-20 20:39:20 +00:00
parent 8c96736565
commit d1c518d416
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Fri Jun 21 05:37:39 2013 Koichi Sasada <ko1@atdot.net>
* gc.c (gc_prof_sweep_timer_stop): accumulate sweep time only when
record->gc_time > 0.
Fri Jun 21 00:37:31 2013 Tanaka Akira <akr@fsij.org>
* ext/bigdecimal: Workaround fix for bigdecimal test failures caused

8
gc.c
View File

@ -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;