summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2022-07-25 10:40:45 -0400
committerPeter Zhu <peter@peterzhu.ca>2022-07-26 09:12:09 -0400
commitefb91ff19b739b759f40af2673f942e80d212857 (patch)
treeace9d897856748fba7537390a6674695af23a0f3 /struct.c
parent3f70aa6504d4c63a3cc928c52d6cf88dafffb40d (diff)
Rename rb_ary_tmp_new to rb_ary_hidden_new
rb_ary_tmp_new suggests that the array is temporary in some way, but that's not true, it just creates an array that's hidden and not on the transient heap. This commit renames it to rb_ary_hidden_new.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6180
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/struct.c b/struct.c
index d1c8ae24f2..7085042b43 100644
--- a/struct.c
+++ b/struct.c
@@ -115,7 +115,7 @@ struct_set_members(VALUE klass, VALUE /* frozen hidden array */ members)
while (mask < members_length * AREF_HASH_UNIT) mask *= 2;
- back = rb_ary_tmp_new(mask + 1);
+ back = rb_ary_hidden_new(mask + 1);
rb_ary_store(back, mask, INT2FIX(members_length));
mask -= 2; /* mask = (2**k-1)*2 */
@@ -810,7 +810,7 @@ rb_struct_new(VALUE klass, ...)
size = rb_long2int(num_members(klass));
if (size > numberof(tmpargs)) {
- tmpargs[0] = rb_ary_tmp_new(size);
+ tmpargs[0] = rb_ary_hidden_new(size);
mem = RARRAY_PTR(tmpargs[0]);
}
va_start(args, klass);