diff options
| author | gingerBill <bill@gingerbill.org> | 2023-01-28 11:53:05 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-01-28 11:53:05 +0000 |
| commit | 94edf89b20d7bef9b9afef82a2d306657e3ace26 (patch) | |
| tree | 3696dde5e608994b8df47e7140ec2b4a55cf060d /src | |
| parent | 8d6ce0b693b12b392a370e96f2bb9394efacd01e (diff) | |
Use a separate arena for `heap_allocator`
Diffstat (limited to 'src')
| -rw-r--r-- | src/common_memory.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common_memory.cpp b/src/common_memory.cpp index d888b7f06..d772eb795 100644 --- a/src/common_memory.cpp +++ b/src/common_memory.cpp @@ -375,6 +375,8 @@ gb_internal bool IS_ODIN_DEBUG(void); 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) { if (IS_ODIN_DEBUG()) { gbAllocator a; @@ -382,7 +384,7 @@ gb_internal gbAllocator heap_allocator(void) { a.data = nullptr; return a; } - return arena_allocator(&permanent_arena); + return arena_allocator(&heap_arena); } |