Doxygen Samurai Engine 0.0.1
Doxygen Samurai Engine Documentation
Loading...
Searching...
No Matches
samurai::memory::CustomAllocator Struct Reference

#include <CustomAllocator.h>

Collaboration diagram for samurai::memory::CustomAllocator:
Collaboration graph

Public Member Functions

 CustomAllocator ()=default
 
 CustomAllocator (void *baseMemory, size_t memorySize)
 
void init (void *baseMemory, size_t memorySize)
 
void * allocate (size_t size)
 
void free (void *mem)
 
void calculateMemoryMetrics (size_t &availableMemory, size_t &biggestBlock, int &freeBlocks)
 

Public Attributes

char * baseMemory = 0
 
void * originalBaseMemory = 0
 
size_t heapSize = 0
 
bool returnZeroIfNoMoreMemory = false
 

Private Member Functions

size_t getEnd ()
 

Private Attributes

void * end = 0
 

Detailed Description

Definition at line 15 of file CustomAllocator.h.

Constructor & Destructor Documentation

◆ CustomAllocator() [1/2]

samurai::memory::CustomAllocator::CustomAllocator ( )
default

◆ CustomAllocator() [2/2]

samurai::memory::CustomAllocator::CustomAllocator ( void * baseMemory,
size_t memorySize )
inline

Definition at line 22 of file CustomAllocator.h.

Here is the call graph for this function:

Member Function Documentation

◆ allocate()

void * samurai::memory::CustomAllocator::allocate ( size_t size)

Definition at line 64 of file CustomAllocator.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calculateMemoryMetrics()

void samurai::memory::CustomAllocator::calculateMemoryMetrics ( size_t & availableMemory,
size_t & biggestBlock,
int & freeBlocks )

Definition at line 435 of file CustomAllocator.cpp.

◆ free()

void samurai::memory::CustomAllocator::free ( void * mem)

Definition at line 269 of file CustomAllocator.cpp.

Here is the caller graph for this function:

◆ getEnd()

size_t samurai::memory::CustomAllocator::getEnd ( )
inlineprivate

Definition at line 53 of file CustomAllocator.h.

Here is the caller graph for this function:

◆ init()

void samurai::memory::CustomAllocator::init ( void * baseMemory,
size_t memorySize )

Definition at line 35 of file CustomAllocator.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ baseMemory

char* samurai::memory::CustomAllocator::baseMemory = 0

Definition at line 17 of file CustomAllocator.h.

◆ end

void* samurai::memory::CustomAllocator::end = 0
private

Definition at line 49 of file CustomAllocator.h.

◆ heapSize

size_t samurai::memory::CustomAllocator::heapSize = 0

Definition at line 19 of file CustomAllocator.h.

◆ originalBaseMemory

void* samurai::memory::CustomAllocator::originalBaseMemory = 0

Definition at line 18 of file CustomAllocator.h.

◆ returnZeroIfNoMoreMemory

bool samurai::memory::CustomAllocator::returnZeroIfNoMoreMemory = false

Definition at line 45 of file CustomAllocator.h.


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