
24-2
Memory Management Tools
Programmer’s Manual
Parameter
Return Value
24.3
Lmalloc
Syntax
void *
Lmalloc
(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 un-initialized.
PPSM returns the size of the largest continuous memory block can be used
when calling Lmalloc( LARGEST_MALLOC_SIZE ).
Parameter
Return Value
Name
Description
ptr
Pointer to a valid memory location. It must
be a pointer returned from one of the
PPSM memory allocation tools.
Name
Description
None
Name
Description
size
The size of memory required by the caller
in number of bytes
or flag
LARGEST_MALLOC_SIZE
when inquiring the size of the largest
continuous memory block
Name
Description
N/A
zero - Not enough memory in the system
non-zero - Pointer to an initialized free
memory region
or
the size of the largest continuous
memory block
Personal Portable System Manager
Programmer’s Manual
24-3
24.4
Lrealloc
Syntax
void *
Lrealloc
(void *ptr
Description
Moving of memory. This routine re-allocates the memory that is being used
from one location to another. It allocates a new area, then copies the content
at the original location to the new area, and frees the original memory back into
the heap. The purpose of this routine is to defragmentize the system memory.
Parameter
Return Value
24.5
MoveBlock
Syntax
STATUS
MoveBlock
Copies a block of memory from the specified source location to the specified
destination location. The tool automatically detects the direction of movement.
Overlapping of memory regions is allowed.
Parameter
Name
Description
ptr
size
Name
Description
N/A
zero - Not enough memory in the system
non-zero - Pointer to a valid free memory
Name
Description
srcAddr
destAddr
size
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.