check if the data method is defined (meaning it's correctly patched)

This commit is contained in:
Gonçalo Silva
2010-06-12 11:37:05 +01:00
committed by wycats
parent 901452d06a
commit cb74cfc9c1

View File

@@ -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