From 7491b3c33210343f01ce1ea6aa27c9a49d8f447f Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Wed, 18 Sep 2024 22:45:27 +0200 Subject: [PATCH] Fix #4265 --- core/os/os2/allocators.odin | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/os/os2/allocators.odin b/core/os/os2/allocators.odin index ddfe230be56..296be98a6eb 100644 --- a/core/os/os2/allocators.odin +++ b/core/os/os2/allocators.odin @@ -22,9 +22,14 @@ global_default_temp_allocator_index: uint @(require_results) temp_allocator :: proc() -> runtime.Allocator { + arena := &global_default_temp_allocator_arenas[global_default_temp_allocator_index] + if arena.backing_allocator.procedure == nil { + arena.backing_allocator = heap_allocator() + } + return runtime.Allocator{ procedure = temp_allocator_proc, - data = &global_default_temp_allocator_arenas[global_default_temp_allocator_index], + data = arena, } }