![](http://datasheet.mmic.net.cn/260000/PPSMMANUAL_datasheet_15946768/PPSMMANUAL_139.png)
24-4
Memory Management Tools
Programmer’s Manual
Return Value
24.6
TaskMemUsed
Syntax
STATUS
TaskMemUsed
(U32 taskId, P_U32 pSizeUsed)
Description
Inquire memory usage of a task. This routine returns to the caller total number
of bytes of memory allocated to the given task through Lmalloc(), Lcalloc or
Lrealloc().
Parameter
Return Value
24.7
TaskStackAvail
Syntax
S32
TaskStackAvail
(void)
Description
PPSM returns to the caller the total number of bytes of stack can still be used by
current task when calling TaskStackAvail(). Positive returned value indicates stack
has not been used up, negative value implies stack has already overflow.
Name
Description
PPSM_OK
Successful operation
PPSM_ERROR
Invalid input arguments
Name
Description
taskId
Identifier of the task
pSizeUsed
Returns the total number of bytes of
memory used by the task with the given
taskId
Name
Description
PPSM_OK
Successful operation
PPSM_ERR_TASK_ID
Invalid task identifier
Personal Portable System Manager
Programmer’s Manual
24-1
Chapter 24 Memory Management Tools
24.1
Lcalloc
Syntax
void *
Lcalloc
(U32 size
Description
Dynamic allocation of run-time memory to the caller. This routine returns to the
caller a pointer to a region of free memory within the malloc size specified in
the Linker Specification File (.SPC). PPSM returns at least the amount of
memory, in number of bytes, that the caller asked for. If there is not enough
memory available in the system, a NULL pointer is returned.
The memory pointed to by the pointer is initialized to zero.
Parameter
Return Value
24.2
Lfree
Syntax
void
Lfree
(void *ptr)
Description
Returns the memory back into the system heap for reuse. The parameter
supplied must be a valid pointer obtained from one of the PPSM memory
allocation tools.
Name
Description
size
Name
Description
N/A
zero - Not enough memory in the system
non-zero - Pointer to an initialized free
memory region
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.