Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
Burger::AllocatorHandle Class Reference
Inheritance diagram for Burger::AllocatorHandle:
Inheritance graph
[legend]
Collaboration diagram for Burger::AllocatorHandle:
Collaboration graph
[legend]

Public Member Functions

const Burger::StaticRTTIget_StaticRTTI (void) const noexcept override
 Get the description to the class.
 
 AllocatorHandle (MemoryManagerHandle *pMemoryManagerHandle) noexcept
 Default Constructor.
 
void * alloc (uintptr_t uSize) const noexcept final
 Allocate memory.
 
void free (const void *pInput) const noexcept final
 Release memory.
 
void * realloc (const void *pInput, uintptr_t uSize) const noexcept final
 Reallocate memory.
 
- Public Member Functions inherited from Burger::AllocatorBase
 AllocatorBase () noexcept=default
 Default constructor.
 
void * alloc_clear (uintptr_t uSize) const noexcept
 Allocate memory that is preinitialized to zero.
 
void * alloc_copy (const void *pInput, uintptr_t uSize) const noexcept
 Allocate a buffer and copy data into it.
 
- Public Member Functions inherited from Burger::Base
const char * get_class_name (void) const noexcept
 Get the name of the class.
 
virtual ~Base () noexcept=default
 Destructor.
 

Static Public Attributes

static const Burger::StaticRTTI g_StaticRTTI
 
- Static Public Attributes inherited from Burger::AllocatorBase
static const Burger::StaticRTTI g_StaticRTTI
 The global description of the class.
 
- Static Public Attributes inherited from Burger::Base
static const Burger::StaticRTTI g_StaticRTTI
 The global description of the class.
 

Private Attributes

MemoryManagerHandlem_pMemoryManagerHandle
 Pointer to MemoryManagerHandle instance for memory allocation.
 

Constructor & Destructor Documentation

◆ AllocatorHandle()

Burger::AllocatorHandle::AllocatorHandle ( MemoryManagerHandle * pMemoryManagerHandle)
inlinenoexcept

Default Constructor.

Parameters
pMemoryManagerHandlePointer to memory manager

Member Function Documentation

◆ alloc()

void * Burger::AllocatorHandle::alloc ( uintptr_t uSize) const
inlinefinalvirtualnoexcept

Allocate memory.


Allocate memory. If the function fails, return nullptr

Parameters
uSizeNumber of bytes to allocate
Returns
Pointer to valid memory or nullptr on error or no memory requested.
See also
free() or alloc_clear()

Implements Burger::AllocatorBase.

◆ free()

void Burger::AllocatorHandle::free ( const void * pInput) const
inlinefinalvirtualnoexcept

Release memory.


If nullptr is passed, do nothing. Otherwise, release the memory.

Parameters
pInputPointer to memory to release, or nullptr.
See also
alloc() or realloc()

Implements Burger::AllocatorBase.

◆ get_StaticRTTI()

const Burger::StaticRTTI * Burger::AllocatorHandle::get_StaticRTTI ( void ) const
overridevirtualnoexcept

Get the description to the class.


This virtual function will pull the pointer to the StaticRTTI instance that has the name of the class. Due to it being virtual, it will be the name of the most derived class.

Returns
Pointer to a global, read only instance of StaticRTTI for the true class

Reimplemented from Burger::AllocatorBase.

◆ realloc()

void * Burger::AllocatorHandle::realloc ( const void * pInput,
uintptr_t uSize ) const
inlinefinalvirtualnoexcept

Reallocate memory.


Call the virtual function to reallocate memory. If the function fails, the memory in pInput is left intact and nullptr is returned. If uSize is zero, pInput is freed and nullptr is returned.

Note
If nullptr is returned, assume the memory point is still valid, and dispose of it if it is not needed. Otherwise memory can leak.
Parameters
pInputPointer to memory to read from and release
uSizeNumber of bytes to allocate
Returns
Pointer to valid memory or nullptr on error or no memory requested.
See also
alloc() or free()

Implements Burger::AllocatorBase.

Member Data Documentation

◆ g_StaticRTTI

const Burger::StaticRTTI Burger::AllocatorHandle::g_StaticRTTI
static

◆ m_pMemoryManagerHandle

MemoryManagerHandle* Burger::AllocatorHandle::m_pMemoryManagerHandle
private

Pointer to MemoryManagerHandle instance for memory allocation.