This commit is contained in:
2026-01-03 18:51:30 +00:00
parent 6d4a72aff9
commit 458046a5d0
2 changed files with 4 additions and 4 deletions

View File

@@ -22,13 +22,13 @@ typedef struct Arena Arena;
#define wapp_mem_arena_init_allocated_commit_and_zero(arena_dptr, base_capacity) \ #define wapp_mem_arena_init_allocated_commit_and_zero(arena_dptr, base_capacity) \
(wapp_mem_arena_init_allocated_custom(arena_dptr, base_capacity, WAPP_MEM_ALLOC_RESERVE | WAPP_MEM_ALLOC_COMMIT, true)) (wapp_mem_arena_init_allocated_custom(arena_dptr, base_capacity, WAPP_MEM_ALLOC_RESERVE | WAPP_MEM_ALLOC_COMMIT, true))
b8 wapp_mem_arena_init_buffer(Arena **arena, u8 *buffer, u64 buffer_size);
/** /**
* Arena initialisation function. `wapp_mem_arena_init_allocated_custom` provides the most * Arena initialisation function. `wapp_mem_arena_init_allocated_custom` provides the most
* control over how the Arena is initialised. Wrapper macros are provided for * control over how the Arena is initialised. Wrapper macros are provided for
* easier use. * easier use.
*/ */
b8 wapp_mem_arena_init_allocated_custom(Arena **arena, u64 base_capacity, MemAllocFlags flags, b8 zero_buffer); b8 wapp_mem_arena_init_allocated_custom(Arena **arena, u64 base_capacity, MemAllocFlags flags, b8 zero_buffer);
b8 wapp_mem_arena_init_buffer(Arena **arena, u8 *buffer, u64 buffer_size);
void *wapp_mem_arena_alloc(Arena *arena, u64 size); void *wapp_mem_arena_alloc(Arena *arena, u64 size);
void *wapp_mem_arena_alloc_aligned(Arena *arena, u64 size, u64 alignment); void *wapp_mem_arena_alloc_aligned(Arena *arena, u64 size, u64 alignment);
void *wapp_mem_arena_realloc(Arena *arena, void *ptr, u64 old_size, u64 new_size); void *wapp_mem_arena_realloc(Arena *arena, void *ptr, u64 old_size, u64 new_size);

View File

@@ -21,7 +21,6 @@ BEGIN_C_LINKAGE
#define wapp_mem_arena_allocator_init_commit_and_zero(base_capacity) \ #define wapp_mem_arena_allocator_init_commit_and_zero(base_capacity) \
(wapp_mem_arena_allocator_init_custom(base_capacity, WAPP_MEM_ALLOC_RESERVE | WAPP_MEM_ALLOC_COMMIT, true)) (wapp_mem_arena_allocator_init_custom(base_capacity, WAPP_MEM_ALLOC_RESERVE | WAPP_MEM_ALLOC_COMMIT, true))
Allocator wapp_mem_arena_allocator_init_with_buffer(u8 *buffer, u64 buffer_size);
/** /**
* Wraps an Arena in an Allocator object. It attempts to initialise the Arena * Wraps an Arena in an Allocator object. It attempts to initialise the Arena
* and, if successful, defines the operations supported by it to be used by the * and, if successful, defines the operations supported by it to be used by the
@@ -34,8 +33,9 @@ Allocator wapp_mem_arena_allocator_init_with_buffer(u8 *buffer, u64 buffer_size)
* the Arena is initialised. Wrapper macros are provided for easier use. * the Arena is initialised. Wrapper macros are provided for easier use.
*/ */
Allocator wapp_mem_arena_allocator_init_custom(u64 base_capacity, MemAllocFlags flags, b8 zero_buffer); Allocator wapp_mem_arena_allocator_init_custom(u64 base_capacity, MemAllocFlags flags, b8 zero_buffer);
void wapp_mem_arena_allocator_clear(Allocator *allocator); Allocator wapp_mem_arena_allocator_init_with_buffer(u8 *buffer, u64 buffer_size);
void wapp_mem_arena_allocator_destroy(Allocator *allocator); void wapp_mem_arena_allocator_clear(Allocator *allocator);
void wapp_mem_arena_allocator_destroy(Allocator *allocator);
#ifdef WAPP_PLATFORM_CPP #ifdef WAPP_PLATFORM_CPP
END_C_LINKAGE END_C_LINKAGE