BUF_free
Application Program Interface
2-23
C Interface
Syntax
status = BUF_free(buf, bufaddr);
Parameters
BUF_Handle buf;
/* buffer pool object handle */
Ptr
bufaddr;
/* address of buffer to free */
Return Value
Bool
status;
/* returned status */
Reentrant
yes
Description
BUF_free frees the specified buffer back to the specified buffer pool. The
newly freed buffer is then available for further allocation by BUF_alloc.
The buf parameter is the handle that identifies the buffer pool object. This
handle is the one returned by the call to BUF_create.
The bufaddr parameter is the pointer returned by the corresponding call
to BUF_alloc.
BUF_free always returns TRUE if DSP/BIOS real-time analysis is
disabled (in the GBL Module Properties). If real-time analysis is enabled,
BUF_free returns TRUE if the bufaddr parameter is within the range of
the specified buffer pool; otherwise it returns FALSE.
The BUF module manages synchronization so that multiple threads can
share the same buffer pool for allocation and free operations.
The time required to successfully execute BUF_free is deterministic
(constant over multiple calls).
Example
extern BUF_Obj bufferPool;
BUF_Handle buffPoolHandle = &bufferPool;
Ptr buffPtr;
...
BUF_free(buffPoolHandle, buffPtr);
See Also
BUF_free
Free a fixed memory buffer into the buffer pool