Skip to content

Commit 4d5cd81

Browse files
committed
ractor_sync.c: use ruby_sized_xfree
1 parent ecb28ce commit 4d5cd81

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

ractor_sync.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
// this file is included by ractor.c
32

43
struct ractor_port {
@@ -32,7 +31,7 @@ ractor_port_mark(void *ptr)
3231
static void
3332
ractor_port_free(void *ptr)
3433
{
35-
xfree(ptr);
34+
SIZED_FREE((struct ractor_port *)ptr);
3635
}
3736

3837
static size_t
@@ -231,7 +230,7 @@ ractor_basket_mark(const struct ractor_basket *b)
231230
static void
232231
ractor_basket_free(struct ractor_basket *b)
233232
{
234-
xfree(b);
233+
SIZED_FREE(b);
235234
}
236235

237236
static struct ractor_basket *
@@ -285,7 +284,7 @@ ractor_queue_free(struct ractor_queue *rq)
285284

286285
VM_ASSERT(ccan_list_empty(&rq->set));
287286

288-
xfree(rq);
287+
SIZED_FREE(rq);
289288
}
290289

291290
RBIMPL_ATTR_MAYBE_UNUSED()
@@ -575,7 +574,7 @@ ractor_monitor(rb_execution_context_t *ec, VALUE self, VALUE port)
575574
RACTOR_UNLOCK(r);
576575

577576
if (terminated) {
578-
xfree(rm);
577+
SIZED_FREE(rm);
579578
ractor_port_send(ec, port, ractor_exit_token(r->sync.legacy_exc), Qfalse);
580579

581580
return Qfalse;
@@ -603,7 +602,7 @@ ractor_unmonitor(rb_execution_context_t *ec, VALUE self, VALUE port)
603602
(unsigned int)ractor_port_id(&rm->port),
604603
(unsigned int)rb_ractor_id(rm->port.r));
605604
ccan_list_del(&rm->node);
606-
xfree(rm);
605+
SIZED_FREE(rm);
607606
}
608607
}
609608
}
@@ -641,7 +640,7 @@ ractor_notify_exit(rb_execution_context_t *ec, rb_ractor_t *cr, VALUE legacy, bo
641640
ractor_try_send(ec, &rm->port, token, false);
642641

643642
ccan_list_del(&rm->node);
644-
xfree(rm);
643+
SIZED_FREE(rm);
645644
}
646645

647646
VM_ASSERT(ccan_list_empty(&cr->sync.monitors));
@@ -1260,7 +1259,7 @@ ractor_selector_free(void *ptr)
12601259
{
12611260
struct ractor_selector *s = ptr;
12621261
st_free_table(s->ports);
1263-
ruby_xfree(ptr);
1262+
SIZED_FREE(s);
12641263
}
12651264

12661265
static size_t

0 commit comments

Comments
 (0)