Gaia-ECS v1.0.0
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::mem::DefaultAllocator Struct Reference

Stateless allocator backed by the platform heap. More...

#include <mem_alloc.h>

Static Public Member Functions

static GAIA_NODISCARD void * alloc (size_t size)
 Allocates an unaligned memory region.
 
static GAIA_NODISCARD void * alloc (const char *name, size_t size)
 Allocates a named unaligned memory region.
 
static GAIA_NODISCARD void * alloc_alig (size_t size, size_t alig)
 Allocates an aligned memory region.
 
static GAIA_NODISCARD void * alloc_alig (const char *name, size_t size, size_t alig)
 Allocates a named aligned memory region.
 
static void free (void *ptr)
 Releases an unaligned memory region.
 
static void free (const char *name, void *ptr)
 Releases a named unaligned memory region.
 
static void free_alig (void *ptr)
 Releases an aligned memory region.
 
static void free_alig (const char *name, void *ptr)
 Releases a named aligned memory region.
 

Detailed Description

Stateless allocator backed by the platform heap.

Member Function Documentation

◆ alloc() [1/2]

static GAIA_NODISCARD void * gaia::mem::DefaultAllocator::alloc ( const char *  name,
size_t  size 
)
inlinestatic

Allocates a named unaligned memory region.

Parameters
nameAllocation name reported to the profiler.
sizeNumber of bytes to allocate.
Returns
Pointer to the allocated region.

◆ alloc() [2/2]

static GAIA_NODISCARD void * gaia::mem::DefaultAllocator::alloc ( size_t  size)
inlinestatic

Allocates an unaligned memory region.

Parameters
sizeNumber of bytes to allocate.
Returns
Pointer to the allocated region.

◆ alloc_alig() [1/2]

static GAIA_NODISCARD void * gaia::mem::DefaultAllocator::alloc_alig ( const char *  name,
size_t  size,
size_t  alig 
)
inlinestatic

Allocates a named aligned memory region.

Parameters
nameAllocation name reported to the profiler.
sizeNumber of bytes to allocate.
aligRequired byte alignment.
Returns
Pointer to the allocated region.

◆ alloc_alig() [2/2]

static GAIA_NODISCARD void * gaia::mem::DefaultAllocator::alloc_alig ( size_t  size,
size_t  alig 
)
inlinestatic

Allocates an aligned memory region.

Parameters
sizeNumber of bytes to allocate.
aligRequired byte alignment.
Returns
Pointer to the allocated region.

◆ free() [1/2]

static void gaia::mem::DefaultAllocator::free ( const char *  name,
void *  ptr 
)
inlinestatic

Releases a named unaligned memory region.

Parameters
nameAllocation name reported to the profiler.
ptrPointer returned by alloc().

◆ free() [2/2]

static void gaia::mem::DefaultAllocator::free ( void *  ptr)
inlinestatic

Releases an unaligned memory region.

Parameters
ptrPointer returned by alloc().

◆ free_alig() [1/2]

static void gaia::mem::DefaultAllocator::free_alig ( const char *  name,
void *  ptr 
)
inlinestatic

Releases a named aligned memory region.

Parameters
nameAllocation name reported to the profiler.
ptrPointer returned by alloc_alig().

◆ free_alig() [2/2]

static void gaia::mem::DefaultAllocator::free_alig ( void *  ptr)
inlinestatic

Releases an aligned memory region.

Parameters
ptrPointer returned by alloc_alig().

The documentation for this struct was generated from the following file: