From: "authorNari (Narihiro Nakamura)" Date: 2012-10-17T16:31:53+09:00 Subject: [ruby-core:48046] [ruby-trunk - Feature #7177][Open] Proposal of a new C API Issue #7177 has been reported by authorNari (Narihiro Nakamura). ---------------------------------------- Feature #7177: Proposal of a new C API https://bugs.ruby-lang.org/issues/7177 Author: authorNari (Narihiro Nakamura) Status: Open Priority: Normal Assignee: authorNari (Narihiro Nakamura) Category: core Target version: 2.0.0 Hi. 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. So I propose to add following new C APIs. * VALUE rb_newobj_of(VALUE klass, VALUE flags); * #define NEWOBJ_OF(obj,type,klass,flags) A patch is here. https://github.com/authorNari/ruby/compare/trunk...rb_newobj2 rb_newobj_of() is named by Matz. I think it's a fitting name. Please let me know if you have more good name. Thanks. -- http://bugs.ruby-lang.org/