Permalink
Browse files

enable_stats added back in since Benchmarker doesn't start RubyProf

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
1 parent 0cef199 commit 113b0ec03cd57b2d4fec6527c4aae30326527ae9 @goncalossilva goncalossilva committed with jeremy Jun 18, 2010
Showing with 9 additions and 1 deletion.
  1. +9 −1 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

0 comments on commit 113b0ec

Please sign in to comment.