Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Memory pool interface. More...
#include <ipool.h>
Public Member Functions | |
virtual size_t | allocation_size () const =0 |
Get size of the allocation per object. Covers all internal overhead, if any. More... | |
virtual size_t | object_size () const =0 |
Get size of the object (without overhead). More... | |
virtual ROC_ATTR_NODISCARD bool | reserve (size_t n_objects)=0 |
Reserve memory for given number of objects. More... | |
virtual void * | allocate ()=0 |
Allocate memory for an object. More... | |
virtual void | deallocate (void *memory)=0 |
Return memory to pool. More... | |
template<class T > | |
void | destroy_object (T &object) |
Destroy object and deallocate its memory. More... | |
|
pure virtual |
Allocate memory for an object.
Implemented in roc::core::SlabPool< T, EmbeddedCapacity >, roc::core::SlabPool< Stream, PreallocatedStreams >, roc::core::SlabPool< SourceNode, PreallocatedSources >, roc::core::SlabPool< roc::core::Buffer >, roc::core::SlabPool< Route, PreallocatedRoutes >, roc::core::SlabPool< roc::packet::Packet >, roc::core::SlabPool< Address, PreallocatedAddresses >, roc::core::SlabPool< Slot >, roc::core::SlabPool< Node, PreallocatedNodes >, and roc::core::LimitedPool.
|
pure virtual |
Get size of the allocation per object. Covers all internal overhead, if any.
Implemented in roc::core::SlabPool< T, EmbeddedCapacity >, roc::core::SlabPool< Stream, PreallocatedStreams >, roc::core::SlabPool< SourceNode, PreallocatedSources >, roc::core::SlabPool< roc::core::Buffer >, roc::core::SlabPool< Route, PreallocatedRoutes >, roc::core::SlabPool< roc::packet::Packet >, roc::core::SlabPool< Address, PreallocatedAddresses >, roc::core::SlabPool< Slot >, roc::core::SlabPool< Node, PreallocatedNodes >, and roc::core::LimitedPool.
|
pure virtual |
Return memory to pool.
Implemented in roc::core::SlabPool< T, EmbeddedCapacity >, roc::core::SlabPool< Stream, PreallocatedStreams >, roc::core::SlabPool< SourceNode, PreallocatedSources >, roc::core::SlabPool< roc::core::Buffer >, roc::core::SlabPool< Route, PreallocatedRoutes >, roc::core::SlabPool< roc::packet::Packet >, roc::core::SlabPool< Address, PreallocatedAddresses >, roc::core::SlabPool< Slot >, roc::core::SlabPool< Node, PreallocatedNodes >, and roc::core::LimitedPool.
|
inline |
|
pure virtual |
Get size of the object (without overhead).
Implemented in roc::core::SlabPool< T, EmbeddedCapacity >, roc::core::SlabPool< Stream, PreallocatedStreams >, roc::core::SlabPool< SourceNode, PreallocatedSources >, roc::core::SlabPool< roc::core::Buffer >, roc::core::SlabPool< Route, PreallocatedRoutes >, roc::core::SlabPool< roc::packet::Packet >, roc::core::SlabPool< Address, PreallocatedAddresses >, roc::core::SlabPool< Slot >, roc::core::SlabPool< Node, PreallocatedNodes >, and roc::core::LimitedPool.
|
pure virtual |
Reserve memory for given number of objects.
Implemented in roc::core::SlabPool< T, EmbeddedCapacity >, roc::core::SlabPool< Stream, PreallocatedStreams >, roc::core::SlabPool< SourceNode, PreallocatedSources >, roc::core::SlabPool< roc::core::Buffer >, roc::core::SlabPool< Route, PreallocatedRoutes >, roc::core::SlabPool< roc::packet::Packet >, roc::core::SlabPool< Address, PreallocatedAddresses >, roc::core::SlabPool< Slot >, roc::core::SlabPool< Node, PreallocatedNodes >, and roc::core::LimitedPool.