Skip to content

Commit

Permalink
Merge branch 'odin-lang:master' into os-get-current-directory-allocat…
Browse files Browse the repository at this point in the history
…or-arg
  • Loading branch information
greenya authored Sep 18, 2024
2 parents 18fd1fe + 7491b3c commit 80622bc
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 80622bc

Please sign in to comment.