* gc.c (gc_profile_total_time): check objspace->profile.next_index > 0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
69ea68cc21
commit
65ad154e2a
@ -1,3 +1,7 @@
|
||||
Thu Jun 20 06:18:01 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* gc.c (gc_profile_total_time): check objspace->profile.next_index > 0.
|
||||
|
||||
Thu Jun 20 05:47:41 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* gc.c (gc_prof_sweep_timer_start): fix merge miss.
|
||||
|
7
gc.c
7
gc.c
@ -5348,10 +5348,11 @@ gc_profile_total_time(VALUE self)
|
||||
{
|
||||
double time = 0;
|
||||
rb_objspace_t *objspace = &rb_objspace;
|
||||
size_t i;
|
||||
size_t count = objspace->profile.next_index - 1;
|
||||
|
||||
if (objspace->profile.run && count > 0) {
|
||||
if (objspace->profile.run && objspace->profile.next_index > 0) {
|
||||
size_t i;
|
||||
size_t count = objspace->profile.next_index - 1;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
time += objspace->profile.record[i].gc_time;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user