summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-08-17 11:12:23 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-08-19 15:10:53 +0900
commit99093e1600ccef17ab99356b689573fcfd336ecc (patch)
treeb0654845b92b038889fff4eab6e1c73b6ba8a4c0 /struct.c
parentd2eeb836344406eff3342b86436cc7eb0f8cc908 (diff)
RHASH_TBL: is now ext-only
It seems almost no internal codes use RHASH_TBL any longer. Why not just eliminate it entirely, so that the macro can be purely ext-only.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3426
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/struct.c b/struct.c
index bc89ec5cfc..d62b6ca021 100644
--- a/struct.c
+++ b/struct.c
@@ -388,9 +388,10 @@ struct_make_members_list(va_list ar)
{
char *mem;
VALUE ary, list = rb_ident_hash_new();
- st_table *tbl = RHASH_TBL(list);
+ st_table *tbl = RHASH_TBL_RAW(list);
RBASIC_CLEAR_CLASS(list);
+ OBJ_WB_UNPROTECT(list);
while ((mem = va_arg(ar, char*)) != 0) {
VALUE sym = rb_sym_intern_ascii_cstr(mem);
if (st_insert(tbl, sym, Qtrue)) {
@@ -583,7 +584,8 @@ rb_struct_s_def(int argc, VALUE *argv, VALUE klass)
rest = rb_ident_hash_new();
RBASIC_CLEAR_CLASS(rest);
- tbl = RHASH_TBL(rest);
+ OBJ_WB_UNPROTECT(rest);
+ tbl = RHASH_TBL_RAW(rest);
for (i=0; i<argc; i++) {
VALUE mem = rb_to_symbol(argv[i]);
if (rb_is_attrset_sym(mem)) {