summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/gc.c b/gc.c
index 735ae85baa..bd6477050d 100644
--- a/gc.c
+++ b/gc.c
@@ -646,8 +646,8 @@ heaps_increment(rb_objspace_t *objspace)
return FALSE;
}
-VALUE
-rb_newobj(void)
+static VALUE
+newobj(VALUE klass, VALUE flags)
{
rb_objspace_t *objspace = &rb_objspace;
VALUE obj;
@@ -688,6 +688,23 @@ rb_newobj(void)
return obj;
}
+VALUE
+rb_newobj(void)
+{
+ return newobj(0, T_NONE);
+}
+
+VALUE
+rb_newobj_of(VALUE klass, VALUE flags)
+{
+ VALUE obj;
+
+ obj = newobj(klass, flags);
+ OBJSETUP(obj, klass, flags);
+
+ return obj;
+}
+
NODE*
rb_node_newnode(enum node_type type, VALUE a0, VALUE a1, VALUE a2)
{