Skip to content

namespace flake::WirePool ​

Functions Overview ​

Name
void *allocate()
voiddeallocate(void * p)
intcarve(Arena & arena)
std::size_tused()
std::size_tcapacity()
std::size_tslotSize()
std::size_tslotAlign()

Function Details ​

function allocate ​

cpp
void * allocate()

Reserve a raw slot for one [Wire](/embed/2.2.0/API/Classes/classflake_1_1Wire.md) subclass instance. The language-level placement-new runs at the call site (every Wire subclass inherits the base's operator new). Returns nullptr on pool exhaustion.

function deallocate ​

cpp
void deallocate(
    void * p
)

Release a slot previously returned by allocate. Caller has already invoked the destructor (per the language).

function carve ​

cpp
int carve(
    Arena & arena
)

Carve the pool's backing slice from arena. Idempotent only via flakeArenaCarveAllPools — direct callers must not carve twice. Returns 0 on success, -1 on arena exhaustion.

function used ​

cpp
std::size_t used()

Diagnostic: number of currently-allocated slots.

function capacity ​

cpp
std::size_t capacity()

Diagnostic: total slot capacity.

function slotSize ​

cpp
std::size_t slotSize()

Compile-time slot size and alignment. Used by arena_globals.cpp to size the default arena buffer.

function slotAlign ​

cpp
std::size_t slotAlign()