Skip to content

Commit

Permalink
Fix #4265
Browse files Browse the repository at this point in the history
  • Loading branch information
laytan committed Sep 18, 2024
1 parent 8814170 commit 7491b3c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/os/os2/allocators.odin
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down

0 comments on commit 7491b3c

Please sign in to comment.