![]() |
Fling Engine
0.00.1
Fling Engine is a game engine written in Vulkan
|
Helpful for allocating/freeing objects of a certain size which have to be created/destroeyed dynamically. More...
#include <FreeList.h>
Public Member Functions | |
| FreeList (void *t_Start, void *t_End, size_t t_ElmSize, size_t t_Alignment=8, size_t t_Offset=0) | |
| Construct a new Free List object. More... | |
| void * | Obtain () noexcept |
| Obtain a chunk of memory of the size and alignment that this list was created with. More... | |
| void | Return (void *t_Ptr) |
| Return a block of memory to the free list. More... | |
Private Attributes | |
| FreeList * | m_Next = nullptr |
| Alias in memory to the next available block. More... | |
Helpful for allocating/freeing objects of a certain size which have to be created/destroeyed dynamically.
| Fling::FreeList::FreeList | ( | void * | t_Start, |
| void * | t_End, | ||
| size_t | t_ElmSize, | ||
| size_t | t_Alignment = 8, |
||
| size_t | t_Offset = 0 |
||
| ) |
Construct a new Free List object.
| t_Start | Start of the memory block to use for this free list |
| t_End | End of the memory block to use for this free list |
| t_ElmSize | Size of an "element" that this list will be used for |
| t_NumElms | Number of elements to store inside this free list |
| t_Alignment | Alignment of the element (default = 8) |
| t_Offset | Offset of the element (default = 0) |
|
inlinenoexcept |
Obtain a chunk of memory of the size and alignment that this list was created with.
|
inline |
Return a block of memory to the free list.
Memory can be returned in any order
|
private |
Alias in memory to the next available block.
Nullptr if none are available
1.8.13