From 99093e1600ccef17ab99356b689573fcfd336ecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Mon, 17 Aug 2020 11:12:23 +0900 Subject: 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. --- ext/coverage/coverage.c | 3 ++- ext/objspace/objspace.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'ext') diff --git a/ext/coverage/coverage.c b/ext/coverage/coverage.c index 49f7ffa0f8..5b29ea2aea 100644 --- a/ext/coverage/coverage.c +++ b/ext/coverage/coverage.c @@ -252,7 +252,8 @@ rb_coverage_peek_result(VALUE klass) if (!RTEST(coverages)) { rb_raise(rb_eRuntimeError, "coverage measurement is not enabled"); } - st_foreach(RHASH_TBL(coverages), coverage_peek_result_i, ncoverages); + OBJ_WB_UNPROTECT(coverages); + st_foreach(RHASH_TBL_RAW(coverages), coverage_peek_result_i, ncoverages); if (current_mode & COVERAGE_TARGET_METHODS) { rb_objspace_each_objects(method_coverage_i, &ncoverages); diff --git a/ext/objspace/objspace.c b/ext/objspace/objspace.c index a9b1e64183..262640d30c 100644 --- a/ext/objspace/objspace.c +++ b/ext/objspace/objspace.c @@ -141,7 +141,8 @@ setup_hash(int argc, VALUE *argv) hash = rb_hash_new(); } else if (!RHASH_EMPTY_P(hash)) { - st_foreach(RHASH_TBL(hash), set_zero_i, hash); + /* WB: no new reference */ + st_foreach(RHASH_TBL_RAW(hash), set_zero_i, hash); } return hash; -- cgit v1.2.3