Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
roc::core::IPool Class Referenceabstract

Memory pool interface. More...

#include <ipool.h>

Inheritance diagram for roc::core::IPool:
roc::core::SlabPool< roc::core::Buffer > roc::core::SlabPool< roc::packet::Packet > roc::core::SlabPool< Slot > roc::core::SlabPool< Route, PreallocatedRoutes > roc::core::SlabPool< SourceNode, PreallocatedSources > roc::core::SlabPool< Stream, PreallocatedStreams > roc::core::SlabPool< Address, PreallocatedAddresses > roc::core::SlabPool< Node, PreallocatedNodes > roc::core::LimitedPool roc::core::SlabPool< T, EmbeddedCapacity >

Public Member Functions

virtual size_t allocation_size () const =0
 Get size of the allocation per object. Covers all internal overhead, if any.
 
virtual size_t object_size () const =0
 Get size of the object (without overhead).
 
virtual ROC_ATTR_NODISCARD bool reserve (size_t n_objects)=0
 Reserve memory for given number of objects.
 
virtual void * allocate ()=0
 Allocate memory for an object.
 
virtual void deallocate (void *memory)=0
 Return memory to pool.
 
template<class T>
void destroy_object (T &object)
 Destroy object and deallocate its memory.
 

Detailed Description

Memory pool interface.

Definition at line 23 of file ipool.h.

Member Function Documentation

◆ allocate()

◆ allocation_size()

◆ deallocate()

◆ destroy_object()

template<class T>
void roc::core::IPool::destroy_object ( T & object)
inline

Destroy object and deallocate its memory.

Definition at line 49 of file ipool.h.

◆ object_size()

◆ reserve()


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