Bug #641: GC patch to cache the most recent heap for is_pointer_to_heap
http://redmine.ruby-lang.org/issues/show/641

Author: Roger Pack
Status: Open, Priority: Normal
Category: core

This patch seems benign and speeds up gc a bit.
In a completely contrived test [meant to hammer the GC]:

require 'benchmark'
require 'pp'
a = []
1_000_000.times { a << [3] }
pp Benchmark.measure { 33.times { GC.start }}

speed went from 
 @real=1.99618101119995,

to
 @real=1.75,

[I think Hongli does something similar with bit field lookups].  A similar patch might work for 1.8.6
Thanks!


----------------------------------------
http://redmine.ruby-lang.org