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 /internal | |
parent | 3f70aa6504d4c63a3cc928c52d6cf88dafffb40d (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 'internal')
-rw-r--r-- | internal/array.h | 2 | ||||
-rw-r--r-- | internal/imemo.h | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/internal/array.h b/internal/array.h index 0de82d9f30..17d91a800b 100644 --- a/internal/array.h +++ b/internal/array.h @@ -26,7 +26,7 @@ VALUE rb_ary_last(int, const VALUE *, VALUE); void rb_ary_set_len(VALUE, long); void rb_ary_delete_same(VALUE, VALUE); -VALUE rb_ary_tmp_new_fill(long capa); +VALUE rb_ary_hidden_new_fill(long capa); VALUE rb_ary_at(VALUE, VALUE); size_t rb_ary_memsize(VALUE); VALUE rb_to_array_type(VALUE obj); diff --git a/internal/imemo.h b/internal/imemo.h index 53d82eb20f..91b524e0a6 100644 --- a/internal/imemo.h +++ b/internal/imemo.h @@ -10,7 +10,7 @@ */ #include "ruby/internal/config.h" #include <stddef.h> /* for size_t */ -#include "internal/array.h" /* for rb_ary_tmp_new_fill */ +#include "internal/array.h" /* for rb_ary_hidden_new_fill */ #include "internal/gc.h" /* for RB_OBJ_WRITE */ #include "ruby/internal/stdbool.h" /* for bool */ #include "ruby/ruby.h" /* for rb_block_call_func_t */ @@ -121,9 +121,9 @@ struct MEMO { #define MEMO_NEW(a, b, c) ((struct MEMO *)rb_imemo_new(imemo_memo, (VALUE)(a), (VALUE)(b), (VALUE)(c), 0)) #define MEMO_FOR(type, value) ((type *)RARRAY_PTR(value)) #define NEW_MEMO_FOR(type, value) \ - ((value) = rb_ary_tmp_new_fill(type_roomof(type, VALUE)), MEMO_FOR(type, value)) + ((value) = rb_ary_hidden_new_fill(type_roomof(type, VALUE)), MEMO_FOR(type, value)) #define NEW_PARTIAL_MEMO_FOR(type, value, member) \ - ((value) = rb_ary_tmp_new_fill(type_roomof(type, VALUE)), \ + ((value) = rb_ary_hidden_new_fill(type_roomof(type, VALUE)), \ rb_ary_set_len((value), offsetof(type, member) / sizeof(VALUE)), \ MEMO_FOR(type, value)) |