Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::core::IPool Class Referenceabstract

Memory pool interface. More...

#include <ipool.h>

Inheritance diagram for roc::core::IPool:

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...
 

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: