summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2026-01-31 16:54:34 +0100
committerJean Boussier <jean.boussier@gmail.com>2026-01-31 17:54:33 +0100
commit4c1120b5fd67cdf15b8c790849e068851369852f (patch)
tree2ab54ae602a9a317415e44dfd1848cecb95fb9a8
parent4292aed14bb9abb4233aa855e1d5ee89c02969f9 (diff)
ractor.c: Replace ruby_xfree by ruby_sized_xfree
-rw-r--r--ractor.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ractor.c b/ractor.c
index 5897ed5430..df8d46b9fe 100644
--- a/ractor.c
+++ b/ractor.c
@@ -299,7 +299,7 @@ ractor_free(void *ptr)
ractor_sync_free(r);
if (!r->main_ractor) {
- ruby_xfree(r);
+ SIZED_FREE(r);
}
}
@@ -2212,7 +2212,7 @@ rb_ractor_local_storage_delkey(rb_ractor_local_key_t key)
RB_VM_LOCKING() {
if (freed_ractor_local_keys.cnt == freed_ractor_local_keys.capa) {
freed_ractor_local_keys.capa = freed_ractor_local_keys.capa ? freed_ractor_local_keys.capa * 2 : 4;
- REALLOC_N(freed_ractor_local_keys.keys, rb_ractor_local_key_t, freed_ractor_local_keys.capa);
+ SIZED_REALLOC_N(freed_ractor_local_keys.keys, rb_ractor_local_key_t, freed_ractor_local_keys.capa, freed_ractor_local_keys.cnt);
}
freed_ractor_local_keys.keys[freed_ractor_local_keys.cnt++] = key;
}
@@ -2311,12 +2311,12 @@ void
rb_ractor_finish_marking(void)
{
for (int i=0; i<freed_ractor_local_keys.cnt; i++) {
- ruby_xfree(freed_ractor_local_keys.keys[i]);
+ SIZED_FREE(freed_ractor_local_keys.keys[i]);
}
freed_ractor_local_keys.cnt = 0;
if (freed_ractor_local_keys.capa > DEFAULT_KEYS_CAPA) {
freed_ractor_local_keys.capa = DEFAULT_KEYS_CAPA;
- REALLOC_N(freed_ractor_local_keys.keys, rb_ractor_local_key_t, DEFAULT_KEYS_CAPA);
+ SIZED_REALLOC_N(freed_ractor_local_keys.keys, rb_ractor_local_key_t, DEFAULT_KEYS_CAPA, freed_ractor_local_keys.capa);
}
}