Implement Allocator wrapper for memory context

This commit is contained in:
Abdelrahman Said
2024-03-24 20:30:14 +00:00
parent 03d2a59948
commit 8a58a1cc48
2 changed files with 7 additions and 0 deletions

View File

@@ -16,6 +16,11 @@ internal MemCTX g_context = {0};
internal Arena *get_arena(CTXDestBuffer buffer);
Allocator wapp_mem_ctx_allocator(CTXDestBuffer buffer) {
Arena *arena = get_arena(buffer);
return wapp_mem_arena_allocator(arena);
}
void wapp_mem_ctx_init(u64 main_buf_capacity, u64 temp_buf_capacity) {
g_context.main_initialised =
wapp_mem_arena_init(&g_context.main, main_buf_capacity);