AN2345 Freescale Semiconductor / Motorola, AN2345 Datasheet - Page 24

no-image

AN2345

Manufacturer Part Number
AN2345
Description
Real-Time Memory Manager for StarCore DSPs
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
VSSM Functions
Return Value
Error Checks
Example Usage
6.3 VSMMMemAllocCreate()
Syntax
Description
Parameters
Return Value
Error Checks
Example Usage
6.4 VSMMMemAlloc()
Syntax
Description
Parameters
Return Value
Error Checks
24
uliBlkSize. The size, in bytes, of each memory block within this heap.
*pucErr. A pointer to an error message that is set by this function.
Address of a memory control block if the heap is created; otherwise (t_VSMM_MEM *)0
VSMM_NO_ERR. If the heap is successfully created.
VSMM_MEM_INVALID_PART. No free partitions (heaps) available.
VSMM_MEM_INVALID_BLKS. The user has specified an invalid number of blocks (must be >= 2).
VSMM_MEM_INVALID_SIZE. The user has specified an invalid block size (must be greater than the
size of a pointer).
pstHeap1Ptr = VSMMMemCreate(aucHeap1, 4, 16384, &ucErrCode);
t_VSMM_MEM
Allocates a memory block from the specified partition and, if successful, creates a fixed-sized memory
partition from the allocated memory block.
*pstPMem. A pointer to the memory control block from which the memory block allocation occurs.
uliNBlks. The number of memory blocks to create within this heap.
uliBlkSize. The size, in bytes, of each memory block within this heap.
*pucErr. A pointer to an error message that is set by this function.
Address of a memory control block if the heap is created; otherwise (t_VSMM_MEM *)0
VSMM_NO_ERR if the heap is successfully created.
VSMM_MEM_INVALID_PART. No free partitions (heaps) available.
VSMM_MEM_INVALID_BLKS. The user specified an invalid number of blocks (must be >= 2).
VSMM_MEM_INVALID_SIZE. The user specified an invalid block size (must be greater than the size
of a pointer).
pstHeap2Ptr = VSMMMemAllocCreate(pstHeap1Ptr, 4, 16384, &ucErrCode);
void
Allocates a memory block from the specified heap.
*pstPMem. A pointer to the MCB of the specified heap.
*pucErr. A pointer to an error message that is set by this function.
Address of a memory block if the allocation is successful; otherwise (void *)0
VSMM_NO_ERR. If the memory block allocation is successful.
*VSMMMemAlloc (t_VSMM_MEM *pstPMem,
Freescale Semiconductor, Inc.
For More Information On This Product,
*VSMMMemAllocCreate (
Go to: www.freescale.com
t_VSMM_MEM *pstPMem,
INT32U uliNBlks,
INT32U uliBlkSize,
INT8U *pucErr)
INT8U *ucErr)

Related parts for AN2345