RADLib
RADical C++ application framework
RADData::RADFixedPool Class Reference

Fixed-size block pool for high-frequency same-size allocations. More...

#include <RADDataStructures.h>

Public Member Functions

 RADFixedPool (size_t blockSize, size_t blockCount)
 Creates a pool with blockSize bytes per block and blockCount blocks. More...
 
void * allocate ()
 Allocates one fixed-size block or returns nullptr when exhausted. More...
 
void deallocate (void *ptr)
 Returns one block to the pool. More...
 
size_t blockSize () const
 Returns the block size. More...
 

Detailed Description

Fixed-size block pool for high-frequency same-size allocations.

Constructor & Destructor Documentation

◆ RADFixedPool()

RADData::RADFixedPool::RADFixedPool ( size_t  blockSize,
size_t  blockCount 
)
inline

Creates a pool with blockSize bytes per block and blockCount blocks.

Member Function Documentation

◆ allocate()

void* RADData::RADFixedPool::allocate ( )
inline

Allocates one fixed-size block or returns nullptr when exhausted.

◆ blockSize()

size_t RADData::RADFixedPool::blockSize ( ) const
inline

Returns the block size.

◆ deallocate()

void RADData::RADFixedPool::deallocate ( void *  ptr)
inline

Returns one block to the pool.


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