A pool allocator for Karma's UObjects.
More...
#include <UObjectAllocator.h>
A pool allocator for Karma's UObjects.
I'd higly recommend Gregory's Game Engine Architecture section 5.2 for introductory level and practical approach to memory system.
A modular memory system https://github.com/ravimohan1991/cppGameMemorySystem Karma's take https://github.com/ravimohan1991/KarmaEngine/wiki/Karma-Smriti
◆ FUObjectAllocator()
Karma::FUObjectAllocator::FUObjectAllocator |
( |
| ) |
|
|
inline |
Constructor, initializes to no permanent object pool
- Since
- Karma 1.0.0
◆ AllocatePermanentObjectPool()
void Karma::FUObjectAllocator::AllocatePermanentObjectPool |
( |
int32_t | InPermanentObjectPoolSize | ) |
|
Allocates and initializes the permanent object pool.
- Parameters
-
InPermanentObjectPoolSize | size of permanent object pool |
- Since
- Karma 1.0.0
◆ AllocateUObject()
UObjectBase * Karma::FUObjectAllocator::AllocateUObject |
( |
size_t | Size, |
|
|
size_t | Alignment, |
|
|
bool | bAllowPermanent ) |
Allocates a UObjectBase from the free store or the permanent object pool.
- Parameters
-
Size | size (in bytes) of UObject to allocate |
Alignment | alignment of uobject to allocate |
bAllowPermanent | if true, allow allocation in the permanent object pool, if it fits |
- Returns
- newly allocated UObjectBase (not really a UObjectBase yet, no constructor like thing has been called).
- Since
- Karma 1.0.0
◆ BootMessage()
void Karma::FUObjectAllocator::BootMessage |
( |
| ) |
|
Prints a debugf message to allow tuning
- Since
- Karma 1.0.0
◆ DumpUObjectsInformation()
void Karma::FUObjectAllocator::DumpUObjectsInformation |
( |
void * | InObject, |
|
|
const std::string & | InName, |
|
|
size_t | InSize, |
|
|
size_t | InAlignment, |
|
|
class UClass * | InClass ) |
A callback based routine for curating statistics of UObjects being allocated
- Since
- Karma 1.0.0
◆ GetAlignedUObjectSize()
uint32_t Karma::FUObjectAllocator::GetAlignedUObjectSize |
( |
| ) |
const |
|
inline |
Get total boundary aligned size of UObject
- Since
- Karma 1.0.0
◆ GetBareUObjectSize()
uint32_t Karma::FUObjectAllocator::GetBareUObjectSize |
( |
| ) |
const |
|
inline |
Get the bare cumulatice size of UObjects
- Since
- Karma 1.0.0
◆ GetNumberOfUObjects()
uint32_t Karma::FUObjectAllocator::GetNumberOfUObjects |
( |
| ) |
const |
|
inline |
Get total number of UObjects
- Since
- Karma 1.0.0
◆ GetPermanentObjectPool()
uint8_t * Karma::FUObjectAllocator::GetPermanentObjectPool |
( |
| ) |
const |
|
inline |
Get the begining of object pool
- Since
- Karma 1.0.0
◆ GetPermanentObjectPoolEnd()
uint8_t * Karma::FUObjectAllocator::GetPermanentObjectPoolEnd |
( |
| ) |
const |
|
inline |
Get the address of memory pool block ending
- Since
- Karma 1.0.0
◆ GetPermanentObjectPoolTail()
uint8_t * Karma::FUObjectAllocator::GetPermanentObjectPoolTail |
( |
| ) |
const |
|
inline |
Returns a UObjectBase to the free store, unless it is in the permanent object pool
- Parameters
-
Object | object to free Get the current position of objectpool tail |
- Since
- Karma 1.0.0
◆ GetPermanentPoolSize()
uint32_t Karma::FUObjectAllocator::GetPermanentPoolSize |
( |
| ) |
const |
|
inline |
Get the total pool size in bytes
- Since
- Karma 1.0.0
◆ Initialize()
void Karma::FUObjectAllocator::Initialize |
( |
uint8_t * | pMemoryStart, |
|
|
size_t | elemetSizeBytes, |
|
|
size_t | numberOfElemets ) |
Initializes the pool allocator with alloted memory variables
- Parameters
-
pMemoryStart | Pointer to the start of the pool memory |
elementSizeBytes | Size of each element in bytes |
numberOfElements | Tota number of UObjects envisoned |
- See also
- KarmaSmriti::StartUp()
- Since
- Karma 1.0.0
◆ RegisterUObjectsStatisticsCallback()
◆ ResidesInPermanentPool()
Checks whether object is part of permanent object pool.
- Parameters
-
Object | object to test as a member of permanent object pool |
- Returns
- true if object is part of permanent object pool, false otherwise
- Since
- Karma 1.0.0
The documentation for this class was generated from the following files: