|
LMMS
|
#include <Allocator.h>
Public Member Functions | |
| Allocator (void) | |
| Allocator (const Allocator &)=delete | |
| virtual | ~Allocator (void) |
| virtual void * | alloc_mem (size_t mem_size)=0 |
| virtual void | dealloc_mem (void *memory)=0 |
| template<typename T, typename... Ts> | |
| T * | alloc (Ts &&... ts) |
| template<typename T, typename... Ts> | |
| T * | valloc (size_t len, Ts &&... ts) |
| template<typename T> | |
| void | dealloc (T *&t) |
| template<typename T> | |
| void | devalloc (T *&t) |
| template<typename T> | |
| void | devalloc (size_t elms, T *&t) |
| void | beginTransaction () |
| void | endTransaction () |
| virtual void | addMemory (void *, size_t mem_size)=0 |
| virtual bool | lowMemory (unsigned n, size_t chunk_size) const =0 |
| bool | memFree (void *pool) const |
| int | memPools () const |
| int | freePools () const |
| unsigned long long | totalAlloced () const |
Public Attributes | |
| struct AllocatorImpl * | impl |
Private Member Functions | |
| void | rollbackTransaction () |
| void | append_alloc_to_memory_transaction (void *new_memory) |
Private Attributes | |
| void * | transaction_alloc_content [max_transaction_length] |
| size_t | transaction_alloc_index |
| bool | transaction_active |
Static Private Attributes | |
| static const size_t | max_transaction_length = 256 |
Allocator Base class subclasses must specify allocation and deallocation
| zyncarla::Allocator::Allocator | ( | void | ) |
|
delete |
|
virtual |
Implemented in zyncarla::AllocatorClass, and zyncarla::DummyAllocator.
|
inline |
High level allocator method, which return a pointer to a class or struct allocated with the specialized subclass strategy
| ts | argument(s) for the constructor of the type T |
| std::bad_alloc | is no memory could be allocated |
|
pure virtual |
Implemented in zyncarla::AllocatorClass, and zyncarla::DummyAllocator.
Append memory block to the list of memory blocks allocated during this transaction
| new_memory | pointer to the memory pointer to freshly allocated |
| void zyncarla::Allocator::beginTransaction | ( | ) |
|
inline |
Implemented in zyncarla::AllocatorClass, and zyncarla::DummyAllocator.
|
inline |
|
inline |
| void zyncarla::Allocator::endTransaction | ( | ) |
| int zyncarla::Allocator::freePools | ( | ) | const |
|
pure virtual |
Implemented in zyncarla::AllocatorClass, and zyncarla::DummyAllocator.
| bool zyncarla::Allocator::memFree | ( | void * | pool | ) | const |
| int zyncarla::Allocator::memPools | ( | ) | const |
|
private |
| unsigned long long zyncarla::Allocator::totalAlloced | ( | ) | const |
|
inline |
High level allocator method, which return a pointer to an array of class or struct allocated with the specialized subclass strategy
| len | the array length |
| ts | argument(s) for the constructor of the type T |
| std::bad_alloc | is no memory could be allocated |
| struct AllocatorImpl* zyncarla::Allocator::impl |
|
staticprivate |
|
private |
|
private |
|
private |