Function in stdx_arena.h

x_arena_create

Create a new arena with the given default chunk size.

X_ARENA_API XArena * x_arena_create(size_t chunk_size);

Returns

pointer to the new arena or NULL if creation fails

Function in stdx_arena.h

x_arena_destroy

Destroy the arena and free all memory.

X_ARENA_API void x_arena_destroy(XArena *arena);

Parameters

XArena *arena
The arena to destroy.
Function in stdx_arena.h

x_arena_has_pointer

checks if a pointer points to arena owned memory

X_ARENA_API bool x_arena_has_pointer(
 const XArena *arena,
 void *ptr
);

Parameters

const XArena *arena
The arena to check for pointer ownership
void *ptr
The pointer to check

Returns

true if ptr points to an address owned by the arena.