MemoryPool Class Reference
#include <MemoryPool.h>
![](../class_memory_pool.png)
# Static Public Member Functions | |
static BYTE * | allocate (int32 numBytes) |
static void | free (BYTE *object) |
static void | printResumedUsage (int32 x, int32 y) |
static void | printDetailedUsage (int32 x, int32 y) |
# Protected Attributes | |
__MEMORY_POOL_ARRAYS BYTE * | poolLocation [__MEMORY_POOLS] |
The actual blocks that constitute the memory pools. | |
uint16 | poolSizes [__MEMORY_POOLS][2] |
Mapping of memory pools to their block and total size. | |
BYTE * | poolLastFreeBlock [__MEMORY_POOLS] |
Array of pointers to the last free block found in each pool to accelerate the next search. |
# Additional Inherited Members | |
![]() | |
void | constructor () |
Class' constructor. | |
const void * | getVTable () |
bool | mutateTo (const void *targetClass) |
![]() | |
static Object | getCast (void *object, ClassPointer targetClassGetClassMethod, ClassPointer baseClassGetClassMethod) |
![]() | |
void * | vTable |
Pointer to the class's virtual table. |
# Detailed Description
Class MemoryPool
Inherits from Object
Implements a memory pool for dynamic object allocation.
Definition at line 54 of file MemoryPool.h.
# Member Function Documentation
# allocate()
Allocate a block big enough to hold the provided amount of bytes.
- Parameters
-
numBytes Total number of bytes to allocate
- Returns
- A pointer to the allocated block
Definition at line 41 of file MemoryPool.c.
# free()
|
static |
Free the memory block in which the provided object was allocated.
- Parameters
-
object Pointer to the memory block to free
Definition at line 206 of file MemoryPool.c.
# printDetailedUsage()
Print all the details of the memory usage.
- Parameters
-
x Screen x coordinate where to print y Screen y coordinate where to print
Definition at line 319 of file MemoryPool.c.
# printResumedUsage()
Print a resume of the memory usage.
- Parameters
-
x Screen x coordinate where to print y Screen y coordinate where to print
Definition at line 264 of file MemoryPool.c.
# Member Data Documentation
# poolLastFreeBlock
|
protected |
Array of pointers to the last free block found in each pool to accelerate the next search.
Definition at line 68 of file MemoryPool.h.
# poolLocation
|
protected |
The actual blocks that constitute the memory pools.
Array of pointers to the beginning of each memory pool
Definition at line 62 of file MemoryPool.h.
# poolSizes
|
protected |
Mapping of memory pools to their block and total size.
Definition at line 65 of file MemoryPool.h.
The documentation for this class was generated from the following files:
- VUEngine-Core/source/Misc/Memory/MemoryPool.h
- VUEngine-Core/source/Misc/Memory/MemoryPool.c