Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Decorator around IArena to make it memory limited. More...
#include <limited_arena.h>
Public Member Functions | |
LimitedArena (IArena &arena, MemoryLimiter &memory_limiter) | |
Initialize. More... | |
virtual void * | allocate (size_t size) |
Allocate memory after checking with the memory limiter. More... | |
virtual void | deallocate (void *ptr) |
Deallocate previously allocated memory. More... | |
virtual size_t | compute_allocated_size (size_t size) const |
Computes how many bytes will be actually allocated if allocate() is called with given size. Covers all internal overhead, if any. More... | |
virtual size_t | allocated_size (void *ptr) const |
Returns how many bytes was allocated for given pointer returned by allocate(). Covers all internal overhead, if any. Returns same value as computed by compute_allocated_size(size). More... | |
Public Member Functions inherited from roc::core::IArena | |
template<class T > | |
void | destroy_object (T &object) |
Destroy object and deallocate its memory. More... | |
Decorator around IArena to make it memory limited.
Definition at line 23 of file limited_arena.h.
roc::core::LimitedArena::LimitedArena | ( | IArena & | arena, |
MemoryLimiter & | memory_limiter | ||
) |
Initialize.
|
virtual |
Allocate memory after checking with the memory limiter.
size
bytes or NULL if memory can't be allocated. Implements roc::core::IArena.
|
virtual |
Returns how many bytes was allocated for given pointer returned by allocate(). Covers all internal overhead, if any. Returns same value as computed by compute_allocated_size(size).
Implements roc::core::IArena.
|
virtual |
Computes how many bytes will be actually allocated if allocate() is called with given size. Covers all internal overhead, if any.
Implements roc::core::IArena.
|
virtual |
Deallocate previously allocated memory.
Implements roc::core::IArena.