From 45f7b78d29cb4798b68e58c3c674631a90d8295d Mon Sep 17 00:00:00 2001 From: ko1 Date: Thu, 20 Jun 2013 09:31:51 +0000 Subject: * benchmark/gc/gcbench.rb: Do not use GC::Profiler::disable because GC::Profiler::disable prohibit to access profiling data. It should be spec bug. Skip GC::Profiler::report if RUBY_VERSION < '2.0.0' git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- benchmark/gc/gcbench.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'benchmark/gc/gcbench.rb') diff --git a/benchmark/gc/gcbench.rb b/benchmark/gc/gcbench.rb index aa92f0827d..12ab042ec3 100644 --- a/benchmark/gc/gcbench.rb +++ b/benchmark/gc/gcbench.rb @@ -12,12 +12,11 @@ GC::Profiler.enable tms = Benchmark.measure{|x| load script } +gc_time = GC::Profiler.total_time +GC::Profiler.report if RUBY_VERSION >= '2.0.0' # before 1.9.3, report() may run infinite loop GC::Profiler.disable -GC::Profiler.report pp GC.stat -gc_time = GC::Profiler.total_time - puts puts script puts Benchmark::CAPTION -- cgit v1.2.3