Versions Compared

Key

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

...

void  OSMemPut (OS_MEM  *p_mem,

...

                void    *p_blk,

...

                OS_ERR  *p_err)

...

...

File

...

Called from

...

...

Code enabled by

...

os_mem.c

...

Task or ISR

...

OS_CFG_MEM_EN

...

10010361001036OSMemPut() returns a memory block back to a memory partition. It is assumed that the user will return the memory block to the same memory partition from which it was allocated. Anchor10010381001038

Arguments

...

10010391001039p_mem Anchor10010411001041

is a pointer to the memory partition control block.

Anchor10010421001042p_blk Anchor10010441001044

is a pointer to the memory block to be returned to the memory partition.

Anchor10010451001045p_err Anchor10010461001046

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

...

classWebWorks_Indent_1

...

OS_ERR_NONE

...

classWebWorks_Indent_2

...

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

...

...

OS_ERR_MEM_INVALID_P_BLK

...

...

classWebWorks_Indent_2

...

if OS_CFG_ARG_CHK_EN is set to 1 in os_cfg.h: if the user passed a NULL pointer for the memory block being returned to the memory partition.

...

classWebWorks_Indent_1

...

OS_ERR_MEM_INVALID_P_MEM

...

classWebWorks_Indent_2

...

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

...

...

classWebWorks_Indent_1

...

OS_ERR_MEM_MEM_FULL

...

...

if returning a memory block to an already full memory partition. This would indicate that the user freed more blocks that were allocated and potentially did not return some of the memory blocks to the proper memory partition.

...

...

Returned Value

...

None Anchor10508431050843

Notes/Warnings

...

Example

...

rowspan15

...