See http://rxr.whitequark.org/mri/source/ruby.c#1794