summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-15 10:32:58 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-15 10:32:58 +0000
commitb5e89e44f12a6e3a42e9515d1d3705d11f9442bf (patch)
treee1fb1a0cd6b9fe28df591c9cbed4e9a4c7fdd4d3 /array.c
parent85691b9578fae7de871fba8084e4c35205b441e9 (diff)
* array.c (rb_ary_tmp_new): added.
This function creates internal use only array (which is completely hided by ObjectSpace.each_object) with filling nil. Otherwise, it can be incldues strange VALUEs. * internal.h: added. * node.h: use rb_ary_tmp_new_fill() for MEMO. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/array.c b/array.c
index 5d327bc..17b9f9d 100644
--- a/array.c
+++ b/array.c
@@ -550,6 +550,15 @@ rb_ary_tmp_new(long capa)
return ary_new(0, capa);
}
+VALUE
+rb_ary_tmp_new_fill(long capa)
+{
+ VALUE ary = ary_new(0, capa);
+ ary_memfill(ary, 0, capa, Qnil);
+ ARY_SET_LEN(ary, capa);
+ return ary;
+}
+
void
rb_ary_free(VALUE ary)
{