MEM_stat
2-226
C Interface
Syntax
status = MEM_stat(segid, statbuf);
Parameters
Int
segid;
/* memory segment identifier */
MEM_Stat
*statbuf;
/* pointer to stat buffer */
Return Value
Bool
status;
/* TRUE if successful */
Description
MEM_stat returns the status of the memory segment specified by segid
in the status structure pointed to by statbuf.
typedef struct MEM_Stat {
MEM_sizep size; /* original size of segment */
MEM_sizep used; /* MADUs used in segment */
size_t length; /* largest contiguous
block */
} MEM_Stat;
All values are expressed in terms of minimum addressable units
(MADUs).
MEM_stat returns TRUE if segid corresponds to a valid memory
segment, and FALSE otherwise. If MEM_stat returns FALSE, the
contents of statbuf are undefined. If the segment has been undefined with
MEM_undefine, this function returns FALSE.
MEM functions that access memory internally lock the memory by calling
the LCK_pend and LCK_post functions. If another task already holds a
lock to the memory, there is a context switch. For this reason, MEM_stat
cannot be called from the context of a SWI or HWI.
Constraints and
Calling Context
❏
MEM_stat cannot be called from a SWI or HWI.
❏
MEM_stat cannot be called if the TSK scheduler is disabled.
MEM_stat
Return the status of a memory segment