summaryrefslogtreecommitdiff
path: root/symbol.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 /symbol.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 'symbol.c')
-rw-r--r--symbol.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/symbol.c b/symbol.c
index e89879982f..6aceab72c1 100644
--- a/symbol.c
+++ b/symbol.c
@@ -91,7 +91,7 @@ Init_sym(void)
rb_obj_hide(dsym_fstrs);
symbols->str_sym = st_init_table_with_size(&symhash, 1000);
- symbols->ids = rb_ary_tmp_new(0);
+ symbols->ids = rb_ary_hidden_new(0);
rb_gc_register_mark_object(symbols->ids);
Init_op_tbl();
@@ -426,7 +426,7 @@ set_id_entry(rb_symbols_t *symbols, rb_id_serial_t num, VALUE str, VALUE sym)
VALUE ary, ids = symbols->ids;
if (idx >= (size_t)RARRAY_LEN(ids) || NIL_P(ary = rb_ary_entry(ids, (long)idx))) {
- ary = rb_ary_tmp_new(ID_ENTRY_UNIT * ID_ENTRY_SIZE);
+ ary = rb_ary_hidden_new(ID_ENTRY_UNIT * ID_ENTRY_SIZE);
rb_ary_store(ids, (long)idx, ary);
}
idx = (num % ID_ENTRY_UNIT) * ID_ENTRY_SIZE;