2#include <UnCompute/Memory/IAllocator.h>
12 void*
Allocate(USize size, USize alignment)
override;
14 [[nodiscard]]
const char*
GetName()
const override;
23 inline SystemAllocator SystemAllocator::m_Instance;
27 return UN_ALIGNED_MALLOC(size, alignment);
32 return UN_ALIGNED_FREE(pointer);
37 return "System allocator";
An interface for memory allocators.
Definition: IAllocator.h:8
This allocator uses platform-specific aligned versions of malloc() and free().
Definition: SystemAllocator.h:8
const char * GetName() const override
Get debug name of the allocator.
Definition: SystemAllocator.h:35
void Deallocate(void *pointer) override
Deallocate memory.
Definition: SystemAllocator.h:30
static SystemAllocator * Get()
Get global static instance of the system allocator.
Definition: SystemAllocator.h:17
void * Allocate(USize size, USize alignment) override
Allocate memory.
Definition: SystemAllocator.h:25