diff options
author | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-20 06:57:51 +0000 |
---|---|---|
committer | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-20 06:57:51 +0000 |
commit | c3a46d6acab5ab063cc6b5808c2b344f110bef12 (patch) | |
tree | 60d786cb4c890e97fb4c314476dd21d0f0ae451d /include/ruby/ruby.h | |
parent | f1e488e5241f52765550a7e5e20d1d7509da5b32 (diff) | |
download | ruby-c3a46d6acab5ab063cc6b5808c2b344f110bef12.tar.gz |
* 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.
* gc.c: ditto
* array.c: use new C API.
* bignum.c: ditto
* class.c: ditto
* complex.c: ditto
* ext/socket/ancdata.c: ditto
* ext/socket/option.c: ditto
* hash.c: ditto
* io.c: ditto
* marshal.c: ditto
* numeric.c: ditto
* object.c: ditto
* random.c: ditto
* range.c: ditto
* rational.c: ditto
* re.c: ditto
* string.c: ditto
* struct.c: ditto
[Feature #7177][Feature #7047]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby/ruby.h')
-rw-r--r-- | include/ruby/ruby.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index f3ad94a1cd..e4afecca1f 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -657,7 +657,9 @@ VALUE rb_uint2big(VALUE); VALUE rb_int2big(SIGNED_VALUE); VALUE rb_newobj(void); +VALUE rb_newobj_of(VALUE, VALUE); #define NEWOBJ(obj,type) type *(obj) = (type*)rb_newobj() +#define NEWOBJ_OF(obj,type,klass,flags) type *(obj) = (type*)rb_newobj_of(klass, flags) #define OBJSETUP(obj,c,t) do {\ RBASIC(obj)->flags = (t);\ RBASIC(obj)->klass = (c);\ |