Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1518ce4

Browse filesBrowse files
committed
Merge branch 'trunk' of https://github.com/ruby/ruby into trunk
2 parents 56a5ae9 + 29dbed1 commit 1518ce4
Copy full SHA for 1518ce4

File tree

Expand file treeCollapse file tree

3 files changed

+17
-1
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+17
-1
lines changed

‎ChangeLog

Copy file name to clipboardExpand all lines: ChangeLog
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Tue Oct 29 11:10:08 2013 Aman Gupta <ruby@tmm1.net>
2+
3+
* gc.c (gc_profile_total_time): fix off-by-one error in
4+
GC::Profiler.total_time.
5+
* test/ruby/test_gc.rb (class TestGc): test for above.
6+
17
Tue Oct 29 09:53:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
28

39
* insns.def, vm.c, vm_insnhelper.c, vm_insnhelper.h, vm_method.c: split

‎gc.c

Copy file name to clipboardExpand all lines: gc.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6140,7 +6140,7 @@ gc_profile_total_time(VALUE self)
61406140

61416141
if (objspace->profile.run && objspace->profile.next_index > 0) {
61426142
size_t i;
6143-
size_t count = objspace->profile.next_index - 1;
6143+
size_t count = objspace->profile.next_index;
61446144

61456145
for (i = 0; i < count; i++) {
61466146
time += objspace->profile.records[i].gc_time;

‎test/ruby/test_gc.rb

Copy file name to clipboardExpand all lines: test/ruby/test_gc.rb
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,16 @@ def test_profiler_clear
166166
eom
167167
end
168168

169+
def test_profiler_total_time
170+
GC::Profiler.enable
171+
GC::Profiler.clear
172+
173+
GC.start
174+
assert_operator(GC::Profiler.total_time, :>, 0)
175+
ensure
176+
GC::Profiler.disable
177+
end
178+
169179
def test_finalizing_main_thread
170180
assert_in_out_err(%w[--disable-gems], <<-EOS, ["\"finalize\""], [], "[ruby-dev:46647]")
171181
ObjectSpace.define_finalizer(Thread.main) { p 'finalize' }

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.