|
Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
|
A typed pool allocator where all allocations are the size of the type T. More...
#include <PoolAllocator.hpp>
Public Member Functions | |
| bool | Initialize (void *ownedMemory, size_t totalSize) |
| bool | Initialize (size_t maxChunkCount) |
| template<typename... Args> | |
| SharedPtr< T > | AllocateShared (Args &&... params) |
| template<typename... Args> | |
| UniquePtr< T > | AllocateUnique (Args &&... params) |
| template<typename... Args> | |
| T * | AllocateRaw (Args &&... params) |
| T * | AllocateWithoutConstructor () |
| void | Deallocate (size_t index) |
| void | Deallocate (void *ptr) |
| void | DeallocateWithoutDestructor (size_t index) |
| void | DeallocateWithoutDestructor (void *ptr) |
Public Member Functions inherited from Grindstone::Memory::Allocators::BasePoolAllocator | |
| void | Clear () |
| void | ClearAndZero () |
| void | Destroy () |
| bool | IsEmpty () const |
| size_t | GetUsedCount () const |
Additional Inherited Members | |
Protected Member Functions inherited from Grindstone::Memory::Allocators::BasePoolAllocator | |
| void * | AllocateImpl () |
| void | SetupLinkedList () |
| void | DeallocateImpl (size_t index) |
| void | DeallocateImpl (void *ptr) |
Protected Attributes inherited from Grindstone::Memory::Allocators::BasePoolAllocator | |
| size_t | totalMemorySize = 0 |
| size_t | chunkSize = 0 |
| size_t | usedChunkCount = 0 |
| size_t | totalChunkCount = 0 |
| FreeLink * | headFreePtr = nullptr |
| void * | memory = nullptr |
| bool | hasAllocatedOwnMemory = false |
| std::function< void(void *)> | deleteFn |
A typed pool allocator where all allocations are the size of the type T.
Memory in a linear allocator is allocated sequentially, similar to a StackAllocator, one after the other. This removes the possibility of fragmentation, but with LinearAllocators specifically, they are never deallocated. Also known as an arena allocator.