summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authornari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-20 06:57:51 +0000
committernari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-20 06:57:51 +0000
commitc3a46d6acab5ab063cc6b5808c2b344f110bef12 (patch)
tree60d786cb4c890e97fb4c314476dd21d0f0ae451d /re.c
parentf1e488e5241f52765550a7e5e20d1d7509da5b32 (diff)
* 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 're.c')
-rw-r--r--re.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/re.c b/re.c
index f512fa4a94..70e3c3fe34 100644
--- a/re.c
+++ b/re.c
@@ -826,8 +826,7 @@ VALUE rb_cMatch;
static VALUE
match_alloc(VALUE klass)
{
- NEWOBJ(match, struct RMatch);
- OBJSETUP(match, klass, T_MATCH);
+ NEWOBJ_OF(match, struct RMatch, klass, T_MATCH);
match->str = 0;
match->rmatch = 0;
@@ -2453,8 +2452,7 @@ rb_reg_initialize_str(VALUE obj, VALUE str, int options, onig_errmsg_buffer err,
static VALUE
rb_reg_s_alloc(VALUE klass)
{
- NEWOBJ(re, struct RRegexp);
- OBJSETUP(re, klass, T_REGEXP);
+ NEWOBJ_OF(re, struct RRegexp, klass, T_REGEXP);
re->ptr = 0;
re->src = 0;