![]() |
Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Decorator around IArena to make it memory limited. More...
#include <roc_core/limited_arena.h>

Public Member Functions | |
| LimitedArena (IArena &arena, MemoryLimiter &memory_limiter) | |
| Initialize. | |
| virtual void * | allocate (size_t size) |
| Allocate memory after checking with the memory limiter. | |
| virtual void | deallocate (void *ptr) |
| Deallocate previously allocated memory. | |
| 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. | |
| 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). | |
Public Member Functions inherited from roc::core::IArena | |
| template<class T > | |
| void | destroy_object (T &object) |
| Destroy object and deallocate its memory. | |
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.
Allocate memory after checking with the memory limiter.
size bytes or NULL if memory can't be allocated. Implements roc::core::IArena.
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.
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.
Deallocate previously allocated memory.
Implements roc::core::IArena.