Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Burger::MemoryManagerGlobalANSI Class Reference

Global ANSI Memory Manager helper class. More...

Inheritance diagram for Burger::MemoryManagerGlobalANSI:
Collaboration diagram for Burger::MemoryManagerGlobalANSI:

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

MemoryManagerm_pPrevious
 Pointer to the previous memory manager.
 

Private Member Functions

 MemoryManagerGlobalANSI (const MemoryManagerGlobalANSI &)=delete
 
MemoryManagerGlobalANSIoperator= (const MemoryManagerGlobalANSI &)=delete
 
 MemoryManagerGlobalANSI (MemoryManagerGlobalANSI &&)=delete
 
MemoryManagerGlobalANSIoperator= (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().
 

Detailed Description

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.

See also
GlobalMemoryManager

Constructor & Destructor Documentation

◆ MemoryManagerGlobalANSI() [1/3]

Burger::MemoryManagerGlobalANSI::MemoryManagerGlobalANSI ( const MemoryManagerGlobalANSI & )
privatedelete

◆ MemoryManagerGlobalANSI() [2/3]

Burger::MemoryManagerGlobalANSI::MemoryManagerGlobalANSI ( MemoryManagerGlobalANSI && )
privatedelete

◆ MemoryManagerGlobalANSI() [3/3]

Burger::MemoryManagerGlobalANSI::MemoryManagerGlobalANSI ( )
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...

void DoSomething()
{
// Tell Burgerlib to use ANSI memory chunks
CallFunctionThatUsesMemory();
CallFunctionThatCleansUpMemory();
// When going out of scope, HandleBasedMemory is restored
}
int main(int,char **)
{
// Use handle based memory
DoSomething();
return 0;
}
Global ANSI Memory Manager helper class.
Definition burger.h:5622
Global Handle Memory Manager helper class.
Definition burger.h:10355

◆ ~MemoryManagerGlobalANSI()

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.

See also
MemoryManagerGlobalANSI(), or GlobalMemoryManager

Member Function Documentation

◆ operator=() [1/2]

MemoryManagerGlobalANSI & Burger::MemoryManagerGlobalANSI::operator= ( const MemoryManagerGlobalANSI & )
privatedelete

◆ operator=() [2/2]

MemoryManagerGlobalANSI & Burger::MemoryManagerGlobalANSI::operator= ( MemoryManagerGlobalANSI && )
privatedelete

Member Data Documentation

◆ m_pPrevious

MemoryManager* Burger::MemoryManagerGlobalANSI::m_pPrevious
protected

Pointer to the previous memory manager.