Skip to content

Commit

Permalink
Assume VM locked in rb_mark_generic_ivar
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
peterzhu2118 committed Oct 4, 2024
1 parent 79a8750 commit cd86393
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions variable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit cd86393

Please sign in to comment.