Skip to content

Commit 0631237

Browse files
committed
Make Ractor::Selector write-barrier protected
1 parent 92688f7 commit 0631237

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ractor_sync.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,7 @@ static const rb_data_type_t ractor_selector_data_type = {
12731273
ractor_selector_memsize,
12741274
NULL, // update
12751275
},
1276-
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
1276+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
12771277
};
12781278

12791279
static struct ractor_selector *
@@ -1318,6 +1318,8 @@ ractor_selector_add(VALUE selv, VALUE rpv)
13181318
}
13191319

13201320
st_insert(s->ports, (st_data_t)rpv, (st_data_t)rp);
1321+
RB_OBJ_WRITTEN(selv, Qundef, rpv);
1322+
13211323
return selv;
13221324
}
13231325

0 commit comments

Comments
 (0)