mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Use a separate arena for heap_allocator
This commit is contained in:
@@ -375,6 +375,8 @@ gb_internal bool IS_ODIN_DEBUG(void);
|
|||||||
|
|
||||||
gb_internal GB_ALLOCATOR_PROC(heap_allocator_proc);
|
gb_internal GB_ALLOCATOR_PROC(heap_allocator_proc);
|
||||||
|
|
||||||
|
|
||||||
|
gb_global gb_thread_local Arena heap_arena = {nullptr, DEFAULT_MINIMUM_BLOCK_SIZE};
|
||||||
gb_internal gbAllocator heap_allocator(void) {
|
gb_internal gbAllocator heap_allocator(void) {
|
||||||
if (IS_ODIN_DEBUG()) {
|
if (IS_ODIN_DEBUG()) {
|
||||||
gbAllocator a;
|
gbAllocator a;
|
||||||
@@ -382,7 +384,7 @@ gb_internal gbAllocator heap_allocator(void) {
|
|||||||
a.data = nullptr;
|
a.data = nullptr;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
return arena_allocator(&permanent_arena);
|
return arena_allocator(&heap_arena);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user