class
SushiDSP::BufferPool
Fixed-capacity pool of block-sized float buffers with allocation-free acquire/release.
- Declared in
include/SushiDSP/core/BufferPool.hpp
Public member functions
BufferPool(std::uint32_t block_size, std::uint32_t max_live_buffers)Preallocates max_live_buffers buffers of block_size floats each.
Parameters
block_sizeNumber of floats per buffer.
max_live_buffersMaximum number of buffers live at once.
float * acquire(std::uint32_t frames)Returns a buffer of at least frames floats, or nullptr if the pool is exhausted.
Parameters
framesNumber of frames the caller needs.
Returns
Pointer to a block_size-float buffer, or nullptr.
void release(float *buffer)Returns a buffer obtained from acquire() to the pool.
Parameters
bufferA pointer acquire() returned.
std::uint32_t capacity() constThe maximum number of buffers that can be live at once.
Returns
The pool capacity in buffers.

