Corium 1.1.0
High-Performance Zero-Heap C++20 MPSC Application Runtime
Loading...
Searching...
No Matches
corium::async::StaticFramePool< MaxFrames, FrameSize > Class Template Reference

Statically-allocated fixed-capacity memory pool for coroutine state frames. Eliminates heap allocations and guarantees deterministic O(1) coroutine frame allocation. More...

#include <FramePool.hpp>

+ Collaboration diagram for corium::async::StaticFramePool< MaxFrames, FrameSize >:

Classes

struct  Slot
 

Static Public Member Functions

static std::size_t activeCount () noexcept
 Number of active frames currently allocated from the pool.
 
static void * allocate (std::size_t size) noexcept
 
static void deallocate (void *ptr, std::size_t) noexcept
 
static void reset () noexcept
 Reset all pool slots to available state.
 

Static Public Attributes

static constexpr std::size_t frame_size = FrameSize
 
static constexpr std::size_t max_frames = MaxFrames
 

Detailed Description

template<std::size_t MaxFrames = 16, std::size_t FrameSize = 256>
class corium::async::StaticFramePool< MaxFrames, FrameSize >

Statically-allocated fixed-capacity memory pool for coroutine state frames. Eliminates heap allocations and guarantees deterministic O(1) coroutine frame allocation.

Template Parameters
MaxFramesMaximum number of concurrent active coroutine frames.
FrameSizeMaximum size in bytes reserved for each coroutine frame.

Member Function Documentation

◆ activeCount()

template<std::size_t MaxFrames = 16, std::size_t FrameSize = 256>
static std::size_t corium::async::StaticFramePool< MaxFrames, FrameSize >::activeCount ( )
inlinestaticnoexcept

Number of active frames currently allocated from the pool.

◆ allocate()

template<std::size_t MaxFrames = 16, std::size_t FrameSize = 256>
static void * corium::async::StaticFramePool< MaxFrames, FrameSize >::allocate ( std::size_t  size)
inlinestaticnoexcept
+ Here is the caller graph for this function:

◆ deallocate()

template<std::size_t MaxFrames = 16, std::size_t FrameSize = 256>
static void corium::async::StaticFramePool< MaxFrames, FrameSize >::deallocate ( void *  ptr,
std::size_t   
)
inlinestaticnoexcept
+ Here is the caller graph for this function:

◆ reset()

template<std::size_t MaxFrames = 16, std::size_t FrameSize = 256>
static void corium::async::StaticFramePool< MaxFrames, FrameSize >::reset ( )
inlinestaticnoexcept

Reset all pool slots to available state.

Member Data Documentation

◆ frame_size

template<std::size_t MaxFrames = 16, std::size_t FrameSize = 256>
constexpr std::size_t corium::async::StaticFramePool< MaxFrames, FrameSize >::frame_size = FrameSize
staticconstexpr

◆ max_frames

template<std::size_t MaxFrames = 16, std::size_t FrameSize = 256>
constexpr std::size_t corium::async::StaticFramePool< MaxFrames, FrameSize >::max_frames = MaxFrames
staticconstexpr

The documentation for this class was generated from the following file: