ANSI Memory Manager. More...
Public Member Functions | |
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. | |
Static Protected Member Functions | |
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(). | |
Private Member Functions | |
MemoryManagerANSI (const MemoryManagerANSI &)=delete | |
MemoryManagerANSI & | operator= (const MemoryManagerANSI &)=delete |
MemoryManagerANSI (MemoryManagerANSI &&)=delete | |
MemoryManagerANSI & | operator= (MemoryManagerANSI &&)=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. | |
ANSI Memory Manager.
This class allocates and releases memory using the ANSI malloc(), free() and realloc() calls. No support is present to track memory is supplied by Burgerlib. If memory tracking is desired either use native memory tracking or use MemoryManagerHandle instead.
|
privatedelete |
|
privatedelete |
|
noexcept |
Constructor for the ANSI memory allocator.
Initializes the jump table in the base class MemoryManager
|
staticprotectednoexcept |
Calls malloc().
Calls malloc() and returns the pointer allocated. If the requested memory size is zero or the call fails, a nullptr is returned.
pThis | Pointer to the current instance. |
uSize | Number of byte requested to allocate. |
|
inlinenoexcept |
Allocates memory.
Calls malloc() and returns the pointer allocated. If the requested memory size is zero or the call fails, a nullptr is returned.
uSize | Number of byte requested to allocate. |
|
inlinenoexcept |
Frees memory.
If pInput is nullptr, do nothing. If non-zero, then release the memory back into the free memory pool.
pInput | nullptr to do no operation or a valid pointer to memory allocated by alloc(uintptr_t) or realloc(const void*, uintptr_t). |
|
staticprotectednoexcept |
Calls free().
If pInput is nullptr, do nothing. If non-zero, then release the memory back into the free memory pool.
pThis | Pointer to the current instance. |
pInput | nullptr to do no operation or a valid pointer to memory allocated by alloc(MemoryManager*,uintptr_t) or realloc(MemoryManager*,const void *,uintptr_t). |
|
privatedelete |
|
privatedelete |
|
inlinenoexcept |
Reallocates memory.
Calls realloc() and returns the pointer allocated. If the requested memory size is zero or the call fails, a nullptr is returned.
pInput | Pointer to a valid buffer to resize. |
uSize | Number of byte requested to allocate. |
|
staticprotectednoexcept |
Calls realloc().
Calls realloc() and returns the pointer allocated. If the requested memory size is zero or the call fails, a nullptr is returned.
pThis | Pointer to the current instance. |
pInput | Pointer to a valid buffer to resize. |
uSize | Number of byte requested to allocate. |