![Texas TMS320C6000 Programmer'S Reference Manual Download Page 23](http://html.mh-extra.com/html/texas/tms320c6000/tms320c6000_programmers-reference-manual_1093844023.webp)
Memory Allocation Support
2-13
Operating System Abstraction API
2.4
Memory Allocation Support
2.4.1
Synopsis
As part of normal stack operation, memory will be allocated and freed on a reg-
ular basis. It is therefore recommended that a memory support system have
the ability to allocate and free small memory blocks in a variety of sizes, without
memory fragmentation. The functions described here work on a memory buck-
et system of predefined fixed sizes. Although it allocates more memory than
requested, when the memory is released, it can be reused without fragmenta-
tion.
2.4.2
Function Overview
The Memory Allocation access functions (in functional order) are as follows:
mmAlloc()
Allocate Small Memory Block
mmFree()
Free mmAlloc() Memory Block
mmBulkAlloc()
Allocate Unrestricted Memory Block
mmBulkRealloc()
Reallocate mmBulkAlloc() Memory Block
mmBulkFree()
Free mmBulkAlloc() Memory Block
2.4.3
Memory Allocation API Functions
Allocate Memory Block
mmAlloc
Syntax
void *mmAlloc( uint size );
Return Value
Pointer to allocated memory or NULL on error
Description
Allocates a memory block of at least size bytes in length. The function should
return a pointer to the new memory block, or NULL if memory is not available.
The size of the allocation cannot be more than 3068 bytes.
Free Memory Block
mmFree
Syntax
int mmFree( void *pv );
Return Value
If a memory tracking error occurs, this function returns 0, else it returns 1
Description
Frees a previously allocated memory block by supplying the pointer that
mmAlloc() originally returned.