Skip to content

Commit

Permalink
enable_stats added back in since Benchmarker doesn't start RubyProf
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information
goncalossilva authored and jeremy committed Jun 18, 2010
1 parent 0cef199 commit 113b0ec
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion activesupport/lib/active_support/testing/performance.rb
Expand Up @@ -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
Expand Down

0 comments on commit 113b0ec

Please sign in to comment.