summaryrefslogtreecommitdiff
path: root/ractor.c
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2026-01-31 11:02:17 +0100
committerJean Boussier <jean.boussier@gmail.com>2026-01-31 17:54:33 +0100
commit9cc71cb9093caa7ee471def8aa8f0de596e366cf (patch)
tree500dac8f1cc2d635405134f40a590c2c87444ee4 /ractor.c
parent0b4b30af9e09be12960ad1e9aff89b195b7c3734 (diff)
Use static memory instead of mimalloc for the VM, main ractor, main thread.
Also allocate fibers with ruby_xmalloc.
Diffstat (limited to 'ractor.c')
-rw-r--r--ractor.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/ractor.c b/ractor.c
index da1db8d803..5897ed5430 100644
--- a/ractor.c
+++ b/ractor.c
@@ -298,10 +298,7 @@ ractor_free(void *ptr)
}
ractor_sync_free(r);
- if (r->main_ractor) {
- ruby_mimfree(r);
- }
- else {
+ if (!r->main_ractor) {
ruby_xfree(r);
}
}
@@ -469,10 +466,12 @@ ractor_alloc(VALUE klass)
return rv;
}
+static rb_ractor_t _main_ractor;
+
rb_ractor_t *
rb_ractor_main_alloc(void)
{
- rb_ractor_t *r = ruby_mimcalloc(1, sizeof(rb_ractor_t));
+ rb_ractor_t *r = &_main_ractor;
if (r == NULL) {
fprintf(stderr, "[FATAL] failed to allocate memory for main ractor\n");
exit(EXIT_FAILURE);