MemoryArena

template<typename T>
class MemoryArena

Memory arena stores contiguous memory.

Public Functions

inline explicit MemoryArena(std::size_t capacity)

Create an arena with capacity elements.

inline T *allocate(std::size_t n)

Allocate n entries from arena.

inline void reset()

Reset the arena to start allocating from the beginning.

inline Marker mark() const

Get marker pointing at the begining of free space in arena.

inline void rewind(Marker m)

Set internal allocation point to marker.