diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2025-09-10 18:02:02 +0100 |
|---|---|---|
| committer | gingerBill <gingerBill@users.noreply.github.com> | 2025-09-10 18:02:02 +0100 |
| commit | af37ba76c1b50c6f4fbe7045446ca645ed604d3e (patch) | |
| tree | 522562634722e2b73eb08699bb7be47d9eb12422 /src/common_memory.cpp | |
| parent | 54df0e1a4170aeceecdf955723ba3044ed082d25 (diff) | |
Use arena in `calculate_global_init_order`
Diffstat (limited to 'src/common_memory.cpp')
| -rw-r--r-- | src/common_memory.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common_memory.cpp b/src/common_memory.cpp index 47b2796a9..9e0222bc4 100644 --- a/src/common_memory.cpp +++ b/src/common_memory.cpp @@ -113,6 +113,13 @@ gb_internal void *arena_alloc(Arena *arena, isize min_size, isize alignment) { return ptr; } + +template <typename T> +gb_internal T *arena_alloc_item(Arena *arena) { + return cast(T *)arena_alloc(arena, gb_size_of(T), gb_align_of(T)); +} + + gb_internal void arena_free_all(Arena *arena) { while (arena->curr_block != nullptr) { MemoryBlock *free_block = arena->curr_block; |