From fad97f1f96caf11005a5858a29d32c66203913e8 Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Wed, 14 Oct 2020 10:43:13 +0900 Subject: sync generic_ivtbl generic_ivtbl is a process global table to maintain instance variables for non T_OBJECT/T_CLASS/... objects. So we need to protect them for multi-Ractor exection. Hint: we can make them Ractor local for unshareable objects, but now it is premature optimization. --- vm_insnhelper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vm_insnhelper.c') diff --git a/vm_insnhelper.c b/vm_insnhelper.c index ea9341429d..275e5f7394 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1101,7 +1101,7 @@ vm_getivar(VALUE obj, ID id, IVC ic, const struct rb_callcache *cc, int is_attr) else if (FL_TEST_RAW(obj, FL_EXIVAR)) { struct gen_ivtbl *ivtbl; - if (LIKELY(st_lookup(rb_ivar_generic_ivtbl(obj), (st_data_t)obj, (st_data_t *)&ivtbl)) && + if (LIKELY(rb_ivar_generic_ivtbl_lookup(obj, &ivtbl)) && LIKELY(index < ivtbl->numiv)) { val = ivtbl->ivptr[index]; } @@ -1123,7 +1123,7 @@ vm_getivar(VALUE obj, ID id, IVC ic, const struct rb_callcache *cc, int is_attr) } else if (FL_TEST_RAW(obj, FL_EXIVAR)) { struct gen_ivtbl *ivtbl; - if (LIKELY(st_lookup(rb_ivar_generic_ivtbl(obj), (st_data_t)obj, (st_data_t *)&ivtbl))) { + if (LIKELY(rb_ivar_generic_ivtbl_lookup(obj, &ivtbl))) { numiv = ivtbl->numiv; ivptr = ivtbl->ivptr; iv_index_tbl = RCLASS_IV_INDEX_TBL(rb_obj_class(obj)); -- cgit v1.2.3