Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

enable_stats added back in since Benchmarker doesn't start RubyProf

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
commit 113b0ec03cd57b2d4fec6527c4aae30326527ae9 1 parent 0cef199
@goncalossilva goncalossilva authored jeremy committed
Showing with 9 additions and 1 deletion.
  1. +9 −1 activesupport/lib/active_support/testing/performance.rb
View
10 activesupport/lib/active_support/testing/performance.rb
@@ -272,7 +272,15 @@ def with_gc_stats
GC.enable
end
- # Ruby 1.8 + ruby-prof wrapper
+ # Ruby 1.8 + ruby-prof wrapper (enable/disable stats for Benchmarker)
+ elsif GC.respond_to?(:enable_stats)
+ def with_gc_stats
+ GC.enable_stats
+ yield
+ ensure
+ GC.disable_stats
+ end
+
else
def with_gc_stats
yield
Please sign in to comment.
Something went wrong with that request. Please try again.