Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
roc::core::HeapAllocator Class Reference

Heap allocator implementation. More...

#include <heap_allocator.h>

Inheritance diagram for roc::core::HeapAllocator:
roc::core::IAllocator roc::core::NonCopyable< T >

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.
 
- Public Member Functions inherited from roc::core::IAllocator
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.
 

Detailed Description

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.

Member Function Documentation

◆ allocate()

virtual void * roc::core::HeapAllocator::allocate ( size_t  size)
virtual

Allocate memory.

Implements roc::core::IAllocator.

◆ deallocate()

virtual void roc::core::HeapAllocator::deallocate ( void *  )
virtual

Deallocate previously allocated memory.

Implements roc::core::IAllocator.

◆ enable_panic_on_leak()

static void roc::core::HeapAllocator::enable_panic_on_leak ( )
static

Enable panic on leak in destructor, for all instances.

◆ num_allocations()

size_t roc::core::HeapAllocator::num_allocations ( ) const

Get number of allocated blocks.


The documentation for this class was generated from the following file: