diff options
author | Peter Zhu <peter@peterzhu.ca> | 2022-07-25 10:40:45 -0400 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2022-07-26 09:12:09 -0400 |
commit | efb91ff19b739b759f40af2673f942e80d212857 (patch) | |
tree | ace9d897856748fba7537390a6674695af23a0f3 /array.c | |
parent | 3f70aa6504d4c63a3cc928c52d6cf88dafffb40d (diff) | |
download | ruby-efb91ff19b739b759f40af2673f942e80d212857.tar.gz |
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.
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -967,7 +967,7 @@ rb_ec_ary_new_from_values(rb_execution_context_t *ec, long n, const VALUE *elts) } VALUE -rb_ary_tmp_new(long capa) +rb_ary_hidden_new(long capa) { VALUE ary = ary_new(0, capa); rb_ary_transient_heap_evacuate(ary, TRUE); @@ -975,7 +975,7 @@ rb_ary_tmp_new(long capa) } VALUE -rb_ary_tmp_new_fill(long capa) +rb_ary_hidden_new_fill(long capa) { VALUE ary = ary_new(0, capa); ary_memfill(ary, 0, capa, Qnil); @@ -5101,7 +5101,7 @@ rb_ary_concat_multi(int argc, VALUE *argv, VALUE ary) } else if (argc > 1) { int i; - VALUE args = rb_ary_tmp_new(argc); + VALUE args = rb_ary_hidden_new(argc); for (i = 0; i < argc; i++) { rb_ary_concat(args, argv[i]); } @@ -6929,8 +6929,6 @@ rb_ary_cycle(int argc, VALUE *argv, VALUE ary) return Qnil; } -#define tmpary(n) rb_ary_tmp_new(n) - /* * Build a ruby array of the corresponding values and yield it to the * associated block. @@ -7625,7 +7623,7 @@ static VALUE rb_ary_product(int argc, VALUE *argv, VALUE ary) { int n = argc+1; /* How many arrays we're operating on */ - volatile VALUE t0 = tmpary(n); + volatile VALUE t0 = rb_ary_hidden_new(n); volatile VALUE t1 = Qundef; VALUE *arrays = RARRAY_PTR(t0); /* The arrays we're computing the product of */ int *counters = ALLOCV_N(int, t1, n); /* The current position in each one */ |