Mem_SegRemSizeGet()

Mem_SegRemSizeGet()

Gets the remaining size available to allocate on the memory segment.

Files

lib_mem.h/lib_mem.c

Prototype

CPU_SIZE_T Mem_SegRemSizeGet (MEM_SEG *p_seg, CPU_SIZE_T align, MEM_SEG_INFO *p_seg_info, LIB_ERR *p_err);

Arguments

p_seg

Pointer to segment data.

align

Alignment in bytes to assume for calculation of free space.

p_seg_info

Pointer to structure that will receive further segment information data (used size, total size, base address and next allocation address). Can be DEF_NULL.

p_err

Pointer to variable that will receive the return error code from this function.

LIB_MEM_ERR_NONE

LIB_MEM_ERR_INVALID_MEM_ALIGN

LIB_MEM_ERR_NULL_PTR

Returned Value

Memory segment remaining size in bytes, if successful.

0, otherwise or if memory segment empty.

Required Configuration

None.

Notes / Warnings

None.