Sdk memory api documentation

Memory allocation functions

Namespace: dmMemory
Include: #include <dmsdk/dlib/memory.h>
ENUMS
Result aligned memory allocation result
FUNCTIONS
void AlignedFree(void* memptr) Frees a block of memory that was allocated with dm...
Result AlignedMalloc(void** memptr, uint32_t alignment, uint32_t size) Allocate size bytes of uninitialized storage whose...

Functions

AlignedFree

void AlignedFree(void* memptr)

Frees a block of memory that was allocated with dmMemory::AlignedMalloc

PARAMETERS

void* memptr A pointer to the memory block that was returned by dmMemory::AlignedMalloc

AlignedMalloc

Result AlignedMalloc(void** memptr, uint32_t alignment, uint32_t size)

Allocate size bytes of uninitialized storage whose alignment is specified by alignment.

PARAMETERS

void** memptr Pointer to a void* where the allocated pointer address should be stored.
uint32_t alignment The alignment value, which must be an integer power of 2.
uint32_t size Size of the requested memory allocation.

RETURNS

Result Returns RESULT_OK on success, RESULT_INVAL if alignment is not a power of 2 and RESULT_NOMEM if out of memory.

Enums

Result

Aligned memory allocation result

dmMemory::RESULT_OK 0
dmMemory::RESULT_INVAL -1
dmMemory::RESULT_NOMEM -2