Morse Micro IoT SDK  2.9.7

Detailed Description

Provides memory management functionality (allocation and free).

Macros

#define mmosal_malloc(size)   mmosal_malloc_(size)
 Allocate memory of the given size and return a pointer to it (malloc). More...
 

Functions

void * mmosal_malloc_ (size_t size)
 Allocate memory of the given size and return a pointer to it (malloc). More...
 
void * mmosal_malloc_dbg (size_t size, const char *name, unsigned line_number)
 Allocate memory of the given size and return a pointer to it (malloc) – debug version. More...
 
void mmosal_free (void *p)
 Free the given memory allocation. More...
 
void * mmosal_realloc (void *ptr, size_t size)
 Equivalent of standard library realloc(). More...
 
void * mmosal_calloc (size_t nitems, size_t size)
 Equivalent of standard library calloc(). More...
 

Macro Definition Documentation

◆ mmosal_malloc

#define mmosal_malloc (   size)    mmosal_malloc_(size)

Allocate memory of the given size and return a pointer to it (malloc).

No guarantees made about initialization.

Parameters
sizeThe amount of memory to allocate (in bytes).
Returns
pointer to the allocated memory on success, or NULL on failure.

Definition at line 137 of file mmosal.h.

Function Documentation

◆ mmosal_calloc()

void * mmosal_calloc ( size_t  nitems,
size_t  size 
)

Equivalent of standard library calloc().

Parameters
nitemsNumber of blocks to allocate
sizeSize of each block.
Returns
pointer to the allocated memory on success, or NULL on failure.

Definition at line 38 of file mmosal_shim_bootloader.c.

◆ mmosal_free()

void mmosal_free ( void *  p)

Free the given memory allocation.

Parameters
pThe memory to free.

Definition at line 43 of file mmosal_shim_bootloader.c.

◆ mmosal_malloc_()

void * mmosal_malloc_ ( size_t  size)

Allocate memory of the given size and return a pointer to it (malloc).

No guarantees made about initialization.

Warning
This function should not be used directly. Instead use mmosal_malloc().
Parameters
sizeThe amount of memory to allocate (in bytes).
Returns
pointer to the allocated memory on success, or NULL on failure.

Definition at line 26 of file mmosal_shim_bootloader.c.

◆ mmosal_malloc_dbg()

void * mmosal_malloc_dbg ( size_t  size,
const char *  name,
unsigned  line_number 
)

Allocate memory of the given size and return a pointer to it (malloc) – debug version.

No guarantees made about initialization.

Warning
This function should not be used directly. Instead use mmosal_malloc().
Parameters
sizeThe amount of memory to allocate (in bytes).
nameName of the function that allocated the memory.
line_numberThe line number at which the allocation happened.
Returns
pointer to the allocated memory on success, or NULL on failure.

Definition at line 31 of file mmosal_shim_bootloader.c.

◆ mmosal_realloc()

void * mmosal_realloc ( void *  ptr,
size_t  size 
)

Equivalent of standard library realloc().

Parameters
ptrPreviously allocated memory block to resize.
sizeThe new size.
Returns
pointer to the resized block of memory, or NULL.