diff options
| author | Jean Boussier <jean.boussier@gmail.com> | 2026-01-31 08:53:48 +0100 |
|---|---|---|
| committer | Jean Boussier <jean.boussier@gmail.com> | 2026-01-31 10:35:48 +0100 |
| commit | bd6fa7f5cca426901bc9162724966339440bc6cb (patch) | |
| tree | 57363875f68945549cb9bc47b7e63950b1d5c6b0 /vm.c | |
| parent | db52e98520349e2bfcd471a0c2f96d696a4f7498 (diff) | |
ruby_xfree: reject memory allocated by ruby_mimalloc
Diffstat (limited to 'vm.c')
| -rw-r--r-- | vm.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -3821,7 +3821,12 @@ thread_free(void *ptr) else { // ruby_xfree(th->nt); // TODO: MN system collect nt, but without MN system it should be freed here. - ruby_xfree(th); + if (th->main_thread) { + ruby_mimfree(th); + } + else { + ruby_xfree(th); + } } RUBY_FREE_LEAVE("thread"); @@ -4594,6 +4599,7 @@ Init_BareVM(void) vm->global_hooks.type = hook_list_type_global; // setup main thread + th->main_thread = 1; th->nt = ZALLOC(struct rb_native_thread); th->vm = vm; th->ractor = vm->ractor.main_ractor = rb_ractor_main_alloc(); |
