![]() |
Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Heap allocator implementation. More...
#include <heap_allocator.h>
Public Member Functions | |
size_t | num_allocations () const |
Get number of allocated blocks. | |
virtual void * | allocate (size_t size) |
Allocate memory. | |
virtual void | deallocate (void *) |
Deallocate previously allocated memory. | |
![]() | |
virtual void * | allocate (size_t size)=0 |
Allocate memory. | |
virtual void | deallocate (void *)=0 |
Deallocate previously allocated memory. | |
template<class T > | |
void | destroy_object (T &object) |
Destroy object and deallocate its memory. | |
Static Public Member Functions | |
static void | enable_panic_on_leak () |
Enable panic on leak in destructor, for all instances. | |
Heap allocator implementation.
Uses global operator new[] and operator delete[].
The memory is always maximum aligned. Thread-safe.
Definition at line 27 of file heap_allocator.h.
|
virtual |
Allocate memory.
Implements roc::core::IAllocator.
|
virtual |
Deallocate previously allocated memory.
Implements roc::core::IAllocator.
|
static |
Enable panic on leak in destructor, for all instances.
size_t roc::core::HeapAllocator::num_allocations | ( | ) | const |
Get number of allocated blocks.