Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
Nz::MemoryManager Class Reference

Core class that represents a manager for the memory. More...

Static Public Member Functions

static void * Allocate (std::size_t size, bool multi=false, const char *file=nullptr, unsigned int line=0)
 Allocates memory. More...
 
static void EnableAllocationFilling (bool allocationFilling)
 Enables the filling of the allocation. More...
 
static void EnableAllocationLogging (bool logAllocations)
 Enables the logging of the allocation. More...
 
static void Free (void *pointer, bool multi=false)
 Frees the pointer. More...
 
static unsigned int GetAllocatedBlockCount ()
 Gets the number of allocated blocks. More...
 
static std::size_t GetAllocatedSize ()
 Gets the allocated size. More...
 
static unsigned int GetAllocationCount ()
 Gets the number of allocations. More...
 
static bool IsAllocationFillingEnabled ()
 Checks whether the filling of allocation is enabled. More...
 
static bool IsAllocationLoggingEnabled ()
 Checks whether the logging of allocation is enabled. More...
 
static void NextFree (const char *file, unsigned int line)
 Sets the next free. More...
 

Detailed Description

Core class that represents a manager for the memory.

Member Function Documentation

◆ Allocate()

void * Nz::MemoryManager::Allocate ( std::size_t  size,
bool  multi = false,
const char *  file = nullptr,
unsigned int  line = 0 
)
static

Allocates memory.

Returns
Raw memory allocated
Parameters
sizeSize to allocate multi Array or not
fileFile of the allocation
lineLine of the allocation in the file

◆ EnableAllocationFilling()

void Nz::MemoryManager::EnableAllocationFilling ( bool  allocationFilling)
static

Enables the filling of the allocation.

Parameters
allocationFillingIf true, sets the rest of the allocation block to '0xFF'

◆ EnableAllocationLogging()

void Nz::MemoryManager::EnableAllocationLogging ( bool  logAllocations)
static

Enables the logging of the allocation.

Parameters
logAllocationsIf true, registers every allocation

◆ Free()

void Nz::MemoryManager::Free ( void *  pointer,
bool  multi = false 
)
static

Frees the pointer.

Parameters
pointerPointer to free
multiArray or not
Remarks
If pointer is nullptr, nothing is done

◆ GetAllocatedBlockCount()

unsigned int Nz::MemoryManager::GetAllocatedBlockCount ( )
static

Gets the number of allocated blocks.

Returns
Number of allocated blocks

◆ GetAllocatedSize()

std::size_t Nz::MemoryManager::GetAllocatedSize ( )
static

Gets the allocated size.

Returns
Size of total allocation

◆ GetAllocationCount()

unsigned int Nz::MemoryManager::GetAllocationCount ( )
static

Gets the number of allocations.

Returns
Number of allocations

◆ IsAllocationFillingEnabled()

bool Nz::MemoryManager::IsAllocationFillingEnabled ( )
static

Checks whether the filling of allocation is enabled.

Returns
true if it is filling

◆ IsAllocationLoggingEnabled()

bool Nz::MemoryManager::IsAllocationLoggingEnabled ( )
static

Checks whether the logging of allocation is enabled.

Returns
true if it is logging

◆ NextFree()

void Nz::MemoryManager::NextFree ( const char *  file,
unsigned int  line 
)
static

Sets the next free.

Parameters
fileName of the file
lineLine in the file

The documentation for this class was generated from the following files: