From 9cc71cb9093caa7ee471def8aa8f0de596e366cf Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Sat, 31 Jan 2026 11:02:17 +0100 Subject: Use static memory instead of mimalloc for the VM, main ractor, main thread. Also allocate fibers with ruby_xmalloc. --- ractor.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'ractor.c') 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); -- cgit v1.2.3