XArena
Arena
typedef struct XArena{
size_t chunk_size;
XArenaChunk *chunks;
XArenaChunk *current;
}XArena;
Arena
typedef struct XArena{
size_t chunk_size;
XArenaChunk *chunks;
XArenaChunk *current;
}XArena;
Create a new arena with the given default chunk size.
X_ARENA_API XArena * x_arena_create(size_t chunk_size);
pointer to the new arena or NULL if creation fails
Destroy the arena and free all memory.
X_ARENA_API void x_arena_destroy(XArena *arena);
XArena *arenachecks if a pointer points to arena owned memory
X_ARENA_API bool x_arena_has_pointer(
const XArena *arena,
void *ptr
);
const XArena *arenavoid *ptrtrue if ptr points to an address owned by the arena.