Skip to content

Commit

Permalink
removed support for 1.8's GC alternative hacks (railsbench and lloyd …
Browse files Browse the repository at this point in the history
…patches). RubyProf can handle it
  • Loading branch information
goncalossilva authored and wycats committed Jun 18, 2010
1 parent cb74cfc commit 36f5d09
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions activesupport/lib/active_support/testing/performance.rb
Expand Up @@ -270,13 +270,6 @@ def with_gc_stats
GC::Profiler.disable
GC.enable
end
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
Expand Down Expand Up @@ -347,18 +340,6 @@ def measure
RubyProf.measure_memory / 1024.0
end

# Ruby 1.8 + railsbench patch
elsif GC.respond_to?(:allocated_size)
def measure
GC.allocated_size / 1024.0
end

# Ruby 1.8 + lloyd patch
elsif GC.respond_to?(:heap_info)
def measure
GC.heap_info['heap_current_memory'] / 1024.0
end

# Ruby 1.9 with total_malloc_allocated_size patch
elsif GC.respond_to?(:malloc_total_allocated_size)
def measure
Expand Down Expand Up @@ -395,12 +376,6 @@ def measure
def measure
RubyProf.measure_allocations
end

# Ruby 1.8 + railsbench patch
elsif ObjectSpace.respond_to?(:allocated_objects)
def measure
ObjectSpace.allocated_objects
end
end

def format(measurement)
Expand Down

0 comments on commit 36f5d09

Please sign in to comment.