Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
|
A dynamic allocator represented by a linked list. More...
#include <DynamicAllocator.hpp>
Classes | |
struct | AllocationHeader |
struct | FreeHeader |
Public Types | |
enum class | SearchPolicy { FirstSearch = 0 , BestSearch } |
Public Member Functions | |
bool | Initialize (size_t size) |
void | Initialize (void *ownedMemory, size_t size) |
void * | AllocateRaw (size_t size, size_t alignment, const char *debugName) |
bool | Free (void *memPtr) |
bool | IsEmpty () const |
size_t | GetTotalMemorySize () const |
size_t | GetPeakSize () const |
size_t | GetUsedSize () const |
void * | GetMemory () const |
template<typename T , typename... Args> | |
Grindstone::Memory::SmartPointers::SharedPtr< T > | AllocateShared (Args &&... params) |
template<typename T , typename... Args> | |
Grindstone::Memory::SmartPointers::UniquePtr< T > | AllocateUnique (Args &&... params) |
template<typename T , typename... Args> | |
T * | AllocateRaw (Args &&... params) |
template<typename T > | |
bool | Free (void *memPtr) |
A dynamic allocator represented by a linked list.
Memory in a dynamic allocator can be allocated and deallocated freely, with no restrictions. Allocations have a header that points to the next block of memory, and so free memory can be found in between allocated blocks of memory.