Global ANSI Memory Manager helper class. More...
Public Member Functions | |
MemoryManagerGlobalANSI () noexcept | |
Attaches a MemoryManagerANSI class to the global memory manager. | |
~MemoryManagerGlobalANSI () | |
Releases a MemoryManagerANSI class from the global memory manager. | |
Public Member Functions inherited from Burger::MemoryManagerANSI | |
MemoryManagerANSI () noexcept | |
Constructor for the ANSI memory allocator. | |
void * | alloc (uintptr_t uSize) noexcept |
Allocates memory. | |
void | free (const void *pInput) noexcept |
Frees memory. | |
void * | realloc (const void *pInput, uintptr_t uSize) noexcept |
Reallocates memory. | |
Public Member Functions inherited from Burger::MemoryManager | |
void * | alloc (uintptr_t uSize) noexcept |
Allocate memory. | |
void | free (const void *pInput) noexcept |
Release memory. | |
void * | realloc (const void *pInput, uintptr_t uSize) noexcept |
Reallocate memory. | |
void | shutdown (void) noexcept |
Shut down the memory manager. | |
void * | alloc_clear (uintptr_t uSize) noexcept |
Allocate a block of pre-zeroed memory. | |
Protected Attributes | |
MemoryManager * | m_pPrevious |
Pointer to the previous memory manager. | |
Private Member Functions | |
MemoryManagerGlobalANSI (const MemoryManagerGlobalANSI &)=delete | |
MemoryManagerGlobalANSI & | operator= (const MemoryManagerGlobalANSI &)=delete |
MemoryManagerGlobalANSI (MemoryManagerGlobalANSI &&)=delete | |
MemoryManagerGlobalANSI & | operator= (MemoryManagerGlobalANSI &&)=delete |
Additional Inherited Members | |
Public Types inherited from Burger::MemoryManager | |
typedef void *(*) | ProcAlloc(MemoryManager *pThis, uintptr_t uSize) |
Function prototype for allocating memory. | |
typedef void(*) | ProcFree(MemoryManager *pThis, const void *pInput) |
Function prototype for releasing memory. | |
typedef void *(*) | ProcRealloc(MemoryManager *pThis, const void *pInput, uintptr_t uSize) |
Function prototype for reallocating memory. | |
typedef void(*) | ProcShutdown(MemoryManager *pThis) |
Function prototype for destructor. | |
Static Public Member Functions inherited from Burger::MemoryManager | |
static void | shutdown (MemoryManager *pThis) noexcept |
Default memory manager destructor. | |
Public Attributes inherited from Burger::MemoryManager | |
ProcAlloc | m_pAlloc |
Pointer to allocation function. | |
ProcFree | m_pFree |
Pointer to memory release function. | |
ProcRealloc | m_pRealloc |
Pointer to the memory reallocation function. | |
ProcShutdown | m_pShutdown |
Pointer to the shutdown function. | |
Static Protected Member Functions inherited from Burger::MemoryManagerANSI | |
static void * | alloc (MemoryManager *pThis, uintptr_t uSize) noexcept |
Calls malloc(). | |
static void | free (MemoryManager *pThis, const void *pInput) noexcept |
Calls free(). | |
static void * | realloc (MemoryManager *pThis, const void *pInput, uintptr_t uSize) noexcept |
Calls realloc(). | |
Global ANSI Memory Manager helper class.
This class is a helper that attaches a MemoryManagerANSI class to the global memory manager. When this instance shuts down, it will remove itself from the global memory manager and set the global memory manager to the previous one.
|
privatedelete |
|
privatedelete |
|
noexcept |
Attaches a MemoryManagerANSI class to the global memory manager.
When this class is created, it will automatically attach itself to the global memory manager and save the pointer to the previous instantiation so when this class goes out of scope, the previous memory manager is reinstated
Example...
Burger::MemoryManagerGlobalANSI::~MemoryManagerGlobalANSI | ( | ) |
Releases a MemoryManagerANSI class from the global memory manager.
When this class is released, it will automatically remove itself to the global memory manager and restore the previous memory manager to the global memory manager.
|
privatedelete |
|
privatedelete |
|
protected |
Pointer to the previous memory manager.