mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Fix #4265
This commit is contained in:
@@ -22,9 +22,14 @@ global_default_temp_allocator_index: uint
|
|||||||
|
|
||||||
@(require_results)
|
@(require_results)
|
||||||
temp_allocator :: proc() -> runtime.Allocator {
|
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{
|
return runtime.Allocator{
|
||||||
procedure = temp_allocator_proc,
|
procedure = temp_allocator_proc,
|
||||||
data = &global_default_temp_allocator_arenas[global_default_temp_allocator_index],
|
data = arena,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user