diff options
author | Gonçalo Silva <goncalossilva@gmail.com> | 2010-06-18 06:11:05 +0100 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-06-17 22:15:16 -0700 |
commit | 113b0ec03cd57b2d4fec6527c4aae30326527ae9 (patch) | |
tree | 73168f8da8d98a2b6d57466dc333f2e5717804bd /activesupport/lib | |
parent | 0cef199c8efcba64b7e7acac036f32adfe293970 (diff) | |
download | rails-113b0ec03cd57b2d4fec6527c4aae30326527ae9.tar.gz rails-113b0ec03cd57b2d4fec6527c4aae30326527ae9.tar.bz2 rails-113b0ec03cd57b2d4fec6527c4aae30326527ae9.zip |
enable_stats added back in since Benchmarker doesn't start RubyProf
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/testing/performance.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/testing/performance.rb b/activesupport/lib/active_support/testing/performance.rb index 836dce2005..cd628a956d 100644 --- a/activesupport/lib/active_support/testing/performance.rb +++ b/activesupport/lib/active_support/testing/performance.rb @@ -272,7 +272,15 @@ begin 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 |