Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
Class Info |
|---|
class MemoryAllocator A memory allocator. |
Constructor Name |
|---|
| A constructor. |
Destructor Name |
|---|
| A destructor. |
Qualifier and Type |
Method Name and Description |
|---|---|
void* |
Alloc(u64 size, u64 alignment = alignof(f64)) Allocates memory aligned by alignment bits. |
inline void |
Flush() Frees memory. |
template<typename T, u64 ALIGN = alignof(T), typename... ARGS> T* |
Allocate(ARGS&& ... args) Allocates memory and initializes an object. |
void |
Frees a resource. |
Constructor |
|---|
MemoryAllocator() A constructor. |
Destructor |
|---|
~MemoryAllocator() A destructor. |
Parameters
Name |
Description |
|---|---|
size |
Memory size, in bytes. |
alignment |
Number of alignment bits. |
Method |
|---|
inline void Flush() Frees memory. |
Method |
|---|
template<typename T, u64 ALIGN = alignof(T), typename... ARGS> T* Allocate(ARGS&& ... args) Allocates memory and initializes an object. |
Parameters
Name |
Description |
|---|---|
args |
Initialization object argument. |
Method |
|---|
void Free(void* p, u64 size) Frees a resource. |
Parameters
Name |
Description |
|---|---|
p |
Resource pointer. |
size |
Resource size. |