BUF_delete
2-22
C Interface
Syntax
status = BUF_delete(buf);
Parameters
BUF_Handle buf;
/* buffer pool object handle */
Return Value
Uns
status;
/* returned status */
Reentrant
no
Description
BUF_delete frees the buffer pool object and the buffer pool memory
referenced by the handle provided.
The buf parameter is the handle that identifies the buffer pool object. This
handle is the one returned by the call to BUF_create. BUF_delete cannot
be used to delete statically created buffer pool objects.
BUF_delete returns 1 if it has successfully freed the memory for the
buffer object and buffer pool. It returns 0 (zero) if it was unable to delete
the buffer pool.
BUF_delete calls MEM_free to delete the BUF object and to free the
buffer pool memory. MEM_free must acquire a lock to the memory before
proceeding. If another task already holds a lock on the memory, there is
a context switch.
The time required to successfully execute BUF_delete is not
deterministic (that is, the time varies over multiple calls).
Constraints and
Calling Context
❏
BUF_delete cannot be called from a SWI or HWI.
❏
BUF_delete cannot be used to delete statically created buffer pool
objects. No check is performed to ensure that this is the case.
❏
BUF_delete assumes that all the buffers allocated from the buffer
pool have been freed back to the pool.
Example
BUF_Handle myBufpool;
Uns delstat;
delstat = BUF_delete(myBufpool);
if( delstat == 0 ){
LOG_printf(&trace,"BUF_delete failed!");
}
See Also
BUF_delete
Delete a dynamically-created buffer pool