ruby/ruby — pull request #462 by simeonwillbanks (2013-12-01 21:42:53+00:00)
Title: Expose serial helper macros

* vm.c (Init_VM): Define RubyVM::InstructionHelper with
singleton methods #method_serial and #constant_serial.
* test/ruby/test_insnhelper.rb: Test new methods.

With `RubyVM::InstructionHelper`, users have visibility into the method and constant caches.

```ruby
def constants_busted?(&blk)
starting = RubyVM::InstructionHelper.constant_serial
yield
ending = RubyVM::InstructionHelper.constant_serial
ending > starting
end

busted = constants_busted? do
class Foo; end
end
puts busted.inspect
# true
```

Thanks for considering; any input is appreciated!