summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2024-10-03 16:20:16 -0400
committerPeter Zhu <[email protected]>2024-10-04 08:50:43 -0400
commitcd86393ad858d29c1204fd3f1561dca9c96fec16 (patch)
tree8239a0e4d3a2929daf2da7fa01af77b4bde4325a /variable.c
parent79a8750ade3e332c1ab78aa9cbc6ca7fd823dec2 (diff)
Assume VM locked in rb_mark_generic_ivar
rb_gen_ivtbl_get locks the VM, but the VM must be locked during marking so we can directly read from the generic_ivtbl without locking the VM.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11785
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/variable.c b/variable.c
index 0dfc5cb7b8..4e55427ff5 100644
--- a/variable.c
+++ b/variable.c
@@ -1107,9 +1107,9 @@ gen_ivtbl_resize(struct gen_ivtbl *old, uint32_t n)
void
rb_mark_generic_ivar(VALUE obj)
{
- struct gen_ivtbl *ivtbl;
-
- if (rb_gen_ivtbl_get(obj, 0, &ivtbl)) {
+ st_data_t data;
+ if (st_lookup(generic_ivtbl_no_ractor_check(obj), (st_data_t)obj, &data)) {
+ struct gen_ivtbl *ivtbl = (struct gen_ivtbl *)data;
if (rb_shape_obj_too_complex(obj)) {
rb_mark_tbl_no_pin(ivtbl->as.complex.table);
}