![]() |
Raven Engine v0.1
|
Central singleton for managing engine memory allocators. More...
#include <MemoryManager.h>
Public Member Functions | |
| MalevolentAllocator & | GetMalevolentAllocator (usize chunkSize, usize chunkCount) |
| Retrieves or creates a pool allocator for fixed-size chunks. | |
| template<typename T> | |
| StackAllocator< T > & | GetStackAllocator (usize elementCount) |
| Retrieves or creates a stack allocator for type T. | |
Static Public Member Functions | |
| static MemoryManager & | Get () |
| Gets the global MemoryManager instance. | |
Central singleton for managing engine memory allocators.
Provides access to pool and stack allocators. Ensures allocators are reused and tracked. Integrates with MemoryTracker for leak detection and profiling.
The MemoryManager provides centralized access to different allocation strategies in the engine, including pool-based (MalevolentAllocator) and stack-based (StackAllocator) allocators. Allocators are created on demand and cached for reuse. This manager also integrates with the memory tracking system for debugging and profiling.
|
inlinestatic |
Gets the global MemoryManager instance.
| MalevolentAllocator & Raven::MemoryManager::GetMalevolentAllocator | ( | usize | chunkSize, |
| usize | chunkCount ) |
Retrieves or creates a pool allocator for fixed-size chunks.
| chunkSize | Size of each chunk in bytes. |
| chunkCount | Number of chunks to allocate. |
|
inline |
Retrieves or creates a stack allocator for type T.
| T | The element type for the stack allocator. |
| elementCount | Number of elements the allocator can hold. |