9#include "prism/compiler/cplusplus.hpp"
A bump allocator for the prism parser.
struct pm_arena_t pm_arena_t
An opaque pointer to an arena that is used for allocations.
Definition arena.h:22
PRISM_NODISCARD PRISM_EXPORTED_FUNCTION pm_arena_t * pm_arena_new(void)
Returns a newly allocated and initialized arena.
PRISM_EXPORTED_FUNCTION void pm_arena_free(pm_arena_t *arena) PRISM_NONNULL(1)
Frees both the held memory and the arena itself.
std::unique_ptr< pm_arena_t, arena_deleter > unique_arena
An owned arena.
Definition arena.hpp:28
unique_arena make_arena() noexcept
Allocate a new arena.
Definition arena.hpp:36
Frees an arena with pm_arena_free.
Definition arena.hpp:18
void operator()(pm_arena_t *arena) const noexcept
Frees the given arena.
Definition arena.hpp:24