From 28eefb33c8d27e5711319873d065e5414d7ffe25 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Sun, 22 Sep 2019 16:21:26 +0900 Subject: variable.c: Rename rb_st_copy to rb_iv_tbl_copy This function was created as a variant of st_copy with firing write barrier. It should have more explicit name, such as st_copy_with_write_barrier. But because it is used only for copying iv_tbl, so I rename it to rb_iv_tbl_copy now. If we face other use case than iv_tbl, we may want to rename it to more general name. --- class.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'class.c') diff --git a/class.c b/class.c index 6b3b6623f1..08e053967a 100644 --- a/class.c +++ b/class.c @@ -341,7 +341,7 @@ rb_mod_init_copy(VALUE clone, VALUE orig) if (RCLASS_IV_TBL(orig)) { st_data_t id; - RCLASS_IV_TBL(clone) = rb_st_copy(clone, RCLASS_IV_TBL(orig)); + rb_iv_tbl_copy(clone, orig); CONST_ID(id, "__tmp_classpath__"); st_delete(RCLASS_IV_TBL(clone), &id, 0); CONST_ID(id, "__classpath__"); @@ -394,7 +394,7 @@ rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach) RCLASS_SET_SUPER(clone, RCLASS_SUPER(klass)); RCLASS_EXT(clone)->allocator = RCLASS_EXT(klass)->allocator; if (RCLASS_IV_TBL(klass)) { - RCLASS_IV_TBL(clone) = rb_st_copy(clone, RCLASS_IV_TBL(klass)); + rb_iv_tbl_copy(clone, klass); } if (RCLASS_CONST_TBL(klass)) { struct clone_const_arg arg; -- cgit v1.2.3