Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Decorator around IPool to make it memory limited. More...
#include <limited_pool.h>
Public Member Functions | |
LimitedPool (IPool &pool, MemoryLimiter &memory_limiter) | |
Initialize. More... | |
virtual size_t | allocation_size () const |
Get size of the allocation per object. More... | |
virtual size_t | object_size () const |
Get size of the object. More... | |
virtual ROC_ATTR_NODISCARD bool | reserve (size_t n_objects) |
Reserve memory for given number of objects. More... | |
virtual void * | allocate () |
Allocate memory for an object, after checking with the memory limiter. More... | |
virtual void | deallocate (void *memory) |
Return memory to pool, then update the memory limiter. More... | |
Public Member Functions inherited from roc::core::IPool | |
template<class T > | |
void | destroy_object (T &object) |
Destroy object and deallocate its memory. More... | |
Decorator around IPool to make it memory limited.
Definition at line 23 of file limited_pool.h.
roc::core::LimitedPool::LimitedPool | ( | IPool & | pool, |
MemoryLimiter & | memory_limiter | ||
) |
Initialize.
|
virtual |
Allocate memory for an object, after checking with the memory limiter.
Implements roc::core::IPool.
|
virtual |
Get size of the allocation per object.
Implements roc::core::IPool.
|
virtual |
Return memory to pool, then update the memory limiter.
Implements roc::core::IPool.
|
virtual |
Get size of the object.
Implements roc::core::IPool.
|
virtual |
Reserve memory for given number of objects.
Implements roc::core::IPool.