| Fling Engine 0.00.1 Fling Engine is a game engine written in Vulkan

StackAllocator.h
Go to the documentation of this file.
1 #pragma once
2
3 #include <stdlib.h> // size_t
4 #include <cstddef> // std::ptrdiff_t
5 #include <assert.h>
6
7 #include "Memory.h"
8
9 namespace Fling
10 {
16 class StackAllocator
17 {
18 public:
25 StackAllocator(void* t_Start, void* t_End);
26 ~StackAllocator();
27
36 void* Allocate(size_t t_Size, size_t t_Alignment = 0, size_t t_Offset = 0);
37
43 void Free(void* t_Ptr);
44
45 private:
46 char* m_Start = nullptr;
47 char* m_End = nullptr;
48 char* m_Current = nullptr;
49 };
50 }
Memory.h
Fling::StackAllocator::m_End
char * m_End
Definition: StackAllocator.h:47
Fling::StackAllocator::StackAllocator
StackAllocator(void *t_Start, void *t_End)
Construct a new Stack Allocator object.
Definition: StackAllocator.cpp:11
Fling::StackAllocator::Free
void Free(void *t_Ptr)
Returns a block of memory to the stack in a LIFO manner.
Definition: StackAllocator.cpp:58
Fling::StackAllocator::~StackAllocator
~StackAllocator()
Definition: StackAllocator.cpp:20
Fling::StackAllocator::Allocate
void * Allocate(size_t t_Size, size_t t_Alignment=0, size_t t_Offset=0)
Definition: StackAllocator.cpp:25
Fling::StackAllocator::m_Current
char * m_Current
Definition: StackAllocator.h:48
Fling
Definition: Engine.h:29
Fling::StackAllocator
Definition: StackAllocator.h:16
Fling::StackAllocator::m_Start
char * m_Start
Definition: StackAllocator.h:46