summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-10-14 10:43:13 +0900
committerKoichi Sasada <ko1@atdot.net>2020-10-14 16:36:55 +0900
commitfad97f1f96caf11005a5858a29d32c66203913e8 (patch)
tree156a20da88b4e1efae3c9f749a1ed0dd2181da86 /vm_insnhelper.c
parentae693fff748c68ca2500bbc2c0a8802d50f269dc (diff)
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.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3655
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c4
1 files changed, 2 insertions, 2 deletions
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));