From cb74cfc9c1c95805fac4f0ff6b9f1465a8bf9d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Silva?= Date: Sat, 12 Jun 2010 11:37:05 +0100 Subject: check if the data method is defined (meaning it's correctly patched) --- activesupport/lib/active_support/testing/performance.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/testing/performance.rb b/activesupport/lib/active_support/testing/performance.rb index 2617763175..cd5f4fc62a 100644 --- a/activesupport/lib/active_support/testing/performance.rb +++ b/activesupport/lib/active_support/testing/performance.rb @@ -331,8 +331,8 @@ begin class Memory < Base Mode = RubyProf::MEMORY if RubyProf.const_defined?(:MEMORY) - # Ruby 1.9 + GC profiler patch - if defined?(GC::Profiler) + # Ruby 1.9 + extented GC profiler patch + if defined?(GC::Profiler) and GC::Profiler.respond_to?(:data) def measure GC.enable GC.start @@ -380,8 +380,8 @@ begin class Objects < Base Mode = RubyProf::ALLOCATIONS if RubyProf.const_defined?(:ALLOCATIONS) - # Ruby 1.9 + GC profiler patch - if defined?(GC::Profiler) + # Ruby 1.9 + extented GC profiler patch + if defined?(GC::Profiler) and GC::Profiler.respond_to?(:data) def measure GC.enable GC.start -- cgit v1.2.3