Arena

Arena: Arena, ~Arena, take, allocate, allocateValue

struct Arena

A bump allocator that keeps allocations stable until the arena is destroyed.

Arena

Arena(uint64 chunkSize = 4096)

Creates an arena whose chunks have the given minimum capacity.

~Arena

~Arena()

Frees all chunks owned by the arena.

take

Arena take()

Moves the arena out, leaving an empty arena in its place.

allocate

T*? allocate<T>()

Allocates uninitialized storage for one value, or returns null on allocation failure.

T[*]? allocate<T>(int64 count)

Allocates uninitialized storage for count values, or returns null on allocation failure.

allocateValue

T*? allocateValue<T>(T value)

Moves the given value into arena-owned storage, or returns null on allocation failure.