diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-19 21:21:16 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-19 21:21:16 +0000 |
commit | 65ad154e2ab959c7b57e566866500b874e6d253a (patch) | |
tree | c1c8eb72fd0bf7f65a4beba2bc58eab6269cc076 /gc.c | |
parent | 69ea68cc21f6539b58c08d8a122fdce3f062a1ce (diff) | |
download | ruby-65ad154e2ab959c7b57e566866500b874e6d253a.tar.gz |
* 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
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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; } |