ObjectSpace._id2ref
Ruby 1.9 と Ruby 2.0 で出力が異なるのはなぜですか?
ルビー 1.9.3p392 i386-mingw32
class Foo ; end
Foo.object_id #=> 17569464
ObjectSpace._id2ref(17569464) #=> Foo
Foo.new.singleton_class.object_id #=> 17075124
ObjectSpace._id2ref(17075124) #=> "\x00"
ルビー 2.0.0p0 i386-mingw32
class Foo ; end
Foo.object_id #=> 17197176
ObjectSpace._id2ref(17197176) #=> Foo
Foo.new.singleton_class.object_id #=> 19181436
ObjectSpace._id2ref(19181436) #=> RangeError: 0x124af7c is recycled object
Foo.new.singleton_class.object_id #=> 17454324
ObjectSpace._id2ref(17454324) #=> RangeError: 0x10a54f4 is not id value
Foo.new.singleton_class.object_id #=> 17139816
ObjectSpace._id2ref(17139816) #=> "c"