template<size_t TCapacityInKB, typename TAllocator = lang::HeapAllocator>
class alib::monomem::TLocalAllocator< TCapacityInKB, TAllocator >
A mono allocator, that incorporates a member of templated size TCapacityInKB, which is used as the initial buffer for allocation. The class is intended to be instantiated by local variables, hence using stack memory.
When the initial buffer is exhausted, further buffers will be heap allocated.
Note that the usual type alias given in namespace alib, in this case misses the leading "T", and is given with LocalAllocator. Besides that, further aliases that denote specific stack sizes are provided with LocalAllocator1K, LocalAllocator2K, LocalAllocator4K, LocalAllocator8K, LocalAllocator16K, LocalAllocator32K, and LocalAllocator64K.
- See also
- Chapter 3.3 Class LocalAllocator of the Programmer's Manual of this ALib Camp.
- Template Parameters
-
Definition at line 35 of file localallocator.inl.
|
| TLocalAllocator (TAllocator &pAllocator, unsigned int pBufferGrowthInPercent=200) |
|
| TLocalAllocator (unsigned int pBufferGrowthInPercent=200) |
|
| ~TLocalAllocator () |
| Destructor. Calls MonoAllocator::destructWithExternalBuffer.
|
|
MonoAllocator & | AsMonoAllocator () |
|
| TMonoAllocator (const char *dbgName, detail::Buffer *pInitialBuffer, size_t pInitialBufferSizeInKB, unsigned int pBufferGrowthInPercent=200) |
|
| TMonoAllocator (const char *dbgName, detail::Buffer *pInitialBuffer, size_t pInitialBufferSizeInKB, unsigned int pBufferGrowthInPercent=200) |
|
| TMonoAllocator (const char *dbgName, lang::HeapAllocator &pAllocator, detail::Buffer *pInitialBuffer, size_t pInitialBufferSizeInKB, unsigned int pBufferGrowthInPercent=200) |
|
| TMonoAllocator (const char *dbgName, lang::HeapAllocator &pAllocator, detail::Buffer *pInitialBuffer, size_t pInitialBufferSizeInKB, unsigned int pBufferGrowthInPercent=200) |
|
ALIB_DLL | TMonoAllocator (const char *dbgName, lang::HeapAllocator &pAllocator, size_t pInitialBufferSizeInKB, unsigned int pBufferGrowthInPercent=200) |
|
ALIB_DLL | TMonoAllocator (const char *dbgName, lang::HeapAllocator &pAllocator, size_t pInitialBufferSizeInKB, unsigned int pBufferGrowthInPercent=200) |
|
| TMonoAllocator (const char *dbgName, size_t pInitialBufferSizeInKB, unsigned int pBufferGrowthInPercent=200) |
|
| TMonoAllocator (const char *dbgName, size_t pInitialBufferSizeInKB, unsigned int pBufferGrowthInPercent=200) |
|
| TMonoAllocator (const char *dbgName, std::nullptr_t) noexcept |
|
| TMonoAllocator (const char *dbgName, std::nullptr_t) noexcept |
|
| TMonoAllocator (const TMonoAllocator &)=delete |
| Not copyable.
|
|
| TMonoAllocator (const TMonoAllocator &)=delete |
| Not copyable.
|
|
| TMonoAllocator (TMonoAllocator &&)=delete |
| Not movable.
|
|
| TMonoAllocator (TMonoAllocator &&)=delete |
| Not movable.
|
|
ALIB_DLL | ~TMonoAllocator () |
| Destructor. Disposes all memory allocated with ChainedAllocator.
|
|
ALIB_DLL | ~TMonoAllocator () |
| Destructor. Disposes all memory allocated with ChainedAllocator.
|
|
void * | allocate (size_t size, size_t alignment) |
|
void * | reallocate (void *mem, size_t oldSize, size_t newSize, size_t alignment) |
|
void | free (void *mem, size_t size) const |
|
void | dbgAcknowledgeIncreasedAllocSize (void *, TSize) const |
|
lang::AllocatorInterface< TMonoAllocator > | operator() () |
|
constexpr bool | allowsMemSplit () noexcept |
|
void * | allocate (size_t size, size_t alignment) |
|
void * | reallocate (void *mem, size_t oldSize, size_t newSize, size_t alignment) |
|
void | free (void *mem, size_t size) const |
|
void | dbgAcknowledgeIncreasedAllocSize (void *, TSize) const |
|
lang::AllocatorInterface< TMonoAllocator > | operator() () |
|
constexpr bool | allowsMemSplit () noexcept |
|
Snapshot | TakeSnapshot () |
|
ALIB_DLL void | Reset (Snapshot snapshot=Snapshot()) |
|
void | Reset (size_t firstObjectSize, size_t firstObjectAlignment) |
|
Snapshot | TakeSnapshot () |
|
ALIB_DLL void | Reset (Snapshot snapshot=Snapshot()) |
|
void | Reset (size_t firstObjectSize, size_t firstObjectAlignment) |
|
ALIB_DLL void | GetStatistics (Statistics &result) |
|
void | DbgLock (bool onOff) noexcept |
|
detail::Buffer * | DbgGetBuffer () noexcept |
|
const detail::Buffer * | DbgGetBuffer () const noexcept |
|
void | dbgCheckMemory (void *mem, TSize size) |
|
const DbgStatistics & | DbgGetStatistics () const |
|
ALIB_DLL void | GetStatistics (Statistics &result) |
|
void | DbgLock (bool onOff) noexcept |
|
detail::Buffer * | DbgGetBuffer () noexcept |
|
const detail::Buffer * | DbgGetBuffer () const noexcept |
|
void | dbgCheckMemory (void *mem, TSize size) |
|
const DbgStatistics & | DbgGetStatistics () const |
|
ALIB_DLL void | destructWithExternalBuffer () |
|
bool | IsInitialized () const noexcept |
|
ALIB_DLL void | destructWithExternalBuffer () |
|
bool | IsInitialized () const noexcept |
|
| AllocatorMember ()=delete |
| Deleted default constructor. (The allocator has to be given with construction)
|
|
| AllocatorMember (lang::HeapAllocator &pAllocator) noexcept |
|
AllocatorInterface< lang::HeapAllocator > | AI () const noexcept |
|
lang::HeapAllocator & | GetAllocator () const noexcept |
|