We uses rb_newobj() in CRuby when we allocates any object.
However, this function has no arguments, so we can not change a
internal allocate method depending klass and flags of any object.
This issue was solved with changeset r37275.
Narihiro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
include/ruby/ruby.h: add C APIs.
VALUE rb_newobj_of(VALUE klass, VALUE flags)
#define NEWOBJ_OF(obj,type,klass,flags)
These allow to change a allocation strategy depending on klass
or flags.