Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

is a pointer to a variable that holds an error code:

OS_ERR_NONE

if a memory block is available and returned to the application.

OS_ERR_MEM_INVALID_P_MEM

if OS_CFG_ARG_CHK_EN is set to 1 in os_cfg.h: if p_mem is a NULL pointer.

OS_ERR_MEM_NO_FREE_BLKS

if the memory partition does not contain additional memory blocks to allocate.

Returned Value

OSMemGet() returns a pointer to the allocated memory block if one is available. If a memory block is not available from the memory partition, OSMemGet() returns a NULL pointer. It is up to the application to “cast” the pointer to the proper data type since OSMemGet() returns a void *.

...