Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Memory pool interface. More...
#include <ipool.h>
Public Member Functions | |
virtual size_t | object_size () const =0 |
Get size of object allocated by pool. 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< roc::core::Buffer< T > >, roc::core::SlabPool< roc::packet::Packet >, roc::core::SlabPool< Slot >, and roc::core::SlabPool< Node, PreallocatedNodes >.
|
pure virtual |
Return memory to pool.
Implemented in roc::core::SlabPool< T, EmbeddedCapacity >, roc::core::SlabPool< roc::core::Buffer< T > >, roc::core::SlabPool< roc::packet::Packet >, roc::core::SlabPool< Slot >, and roc::core::SlabPool< Node, PreallocatedNodes >.
|
inline |
|
pure virtual |
Get size of object allocated by pool.
Implemented in roc::core::SlabPool< T, EmbeddedCapacity >, roc::core::SlabPool< roc::core::Buffer< T > >, roc::core::SlabPool< roc::packet::Packet >, roc::core::SlabPool< Slot >, and roc::core::SlabPool< Node, PreallocatedNodes >.
|
pure virtual |
Reserve memory for given number of objects.
Implemented in roc::core::SlabPool< T, EmbeddedCapacity >, roc::core::SlabPool< roc::core::Buffer< T > >, roc::core::SlabPool< roc::packet::Packet >, roc::core::SlabPool< Slot >, and roc::core::SlabPool< Node, PreallocatedNodes >.