Skip to content
This repository
Browse code

GcTime incorrectly checks GC.respond_to?(:total_time), it should chec…

…k GC::Profiler.respond_to?(:total_time)

[#6435 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
  • Loading branch information...
commit 0cee3034c4bb26e8b82bda513694b9e650961744 1 parent e08873f
Joel Nimety authored spastorino committed
2  activesupport/lib/active_support/testing/performance.rb
@@ -401,7 +401,7 @@ class GcTime < Base
401 401
             Mode = RubyProf::GC_TIME if RubyProf.const_defined?(:GC_TIME)
402 402
 
403 403
             # Ruby 1.9 with GC::Profiler
404  
-            if GC.respond_to?(:total_time)
  404
+            if defined?(GC::Profiler) && GC::Profiler.respond_to?(:total_time)
405 405
               def measure
406 406
                 GC::Profiler.total_time
407 407
               end

0 notes on commit 0cee303

Please sign in to comment.
Something went wrong with that request. Please try again.