Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
Grindstone::Memory::Allocators::DynamicAllocator Class Reference

A dynamic allocator represented by a linked list. More...

#include <DynamicAllocator.hpp>

Classes

struct  FreeHeader
struct  AllocationHeader

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>
Grindstone::SharedPtr< T > MakeShared (T *ptr)
template<typename T>
Grindstone::UniquePtr< T > MakeUnique (T *ptr)
template<typename T, typename... Args>
Grindstone::SharedPtr< T > AllocateShared (Args &&... params)
template<typename T, typename... Args>
Grindstone::UniquePtr< T > AllocateUnique (Args &&... params)
template<typename T, typename... Args>
T * AllocateRaw (Args &&... params)
template<typename T>
bool Free (void *memPtr)

Static Public Attributes

static const size_t DEBUG_NAME_SIZE = 128

Detailed Description

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.


The documentation for this class was generated from the following files:
  • /github/workspace/sources/code/Common/Memory/Allocators/DynamicAllocator.hpp
  • /github/workspace/sources/code/Common/Memory/Allocators/DynamicAllocator.cpp