From 113b0ec03cd57b2d4fec6527c4aae30326527ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Silva?= Date: Fri, 18 Jun 2010 06:11:05 +0100 Subject: enable_stats added back in since Benchmarker doesn't start RubyProf Signed-off-by: Jeremy Kemper --- activesupport/lib/active_support/testing/performance.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'activesupport') 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 -- cgit v1.2.3