Functions that manage buffer pool.
More...
|
| ptxStatus_t | ptxBufferPool_Init (ptxBufferPool_t *bufPool, struct ptxOsal *osAl, ptxLog_t *logCtx, size_t maxNumBuffers, size_t memSize, uint8_t logDetails) |
| | Initialize the buffer pool. Allocate a number of buffers.
|
| |
| ptxStatus_t | ptxBufferPool_DeInit (ptxBufferPool_t *bufPool) |
| | De-initialize the component, release all resources.
|
| |
| ptxStatus_t | ptxBufferPool_ProvideItem (ptxBufferPool_t *bufPool, ptxBufferPool_Item_t **poolItem, size_t sizeReq) |
| | Provide a buffer that is currently not in use. Wait for a buffer to become free if there is currently none.
|
| |
| ptxStatus_t | ptxBufferPool_ClaimItem (ptxBufferPool_Item_t *poolItem) |
| | Claim an item to prevent it from being garbage-collected.
|
| |
| ptxStatus_t | ptxBufferPool_ReleaseItem (ptxBufferPool_Item_t *poolItem) |
| | Release an item and allow it to be garbage-collected.
|
| |
| ptxStatus_t | ptxBufferPool_ReleaseUnusedItem (ptxBufferPool_Item_t *poolItem) |
| | Mark an unused buffer disposable.
|
| |
| ptxStatus_t | ptxBufferPool_ProvideAndClaimItem (ptxBufferPool_t *bufPool, ptxBufferPool_Item_t **poolItem, size_t sizeReq) |
| | Combines the two functions Provide() and Claim().
|
| |
| uint8_t * | ptxBufferPool_GetBuffer (ptxBufferPool_Item_t *poolItem) |
| | Get the buffer.
|
| |
| size_t * | ptxBufferPool_PointToLength (ptxBufferPool_Item_t *poolItem) |
| | Get the current buffer length pointer.
|
| |
| size_t | ptxBufferPool_GetLength (ptxBufferPool_Item_t *poolItem) |
| | Get the buffer length.
|
| |
Functions that manage buffer pool.
◆ ptxBufferPool_ClaimItem()
Claim an item to prevent it from being garbage-collected.
- Parameters
-
- Returns
- Status of the operation. See definition of ptxStatus_t.
◆ ptxBufferPool_DeInit()
De-initialize the component, release all resources.
- Parameters
-
- Returns
- Status of the operation. See definition of ptxStatus_t.
◆ ptxBufferPool_GetBuffer()
Get the buffer.
- Parameters
-
- Returns
- Pointer to the first element of the plain buffer
◆ ptxBufferPool_GetLength()
Get the buffer length.
- Parameters
-
- Returns
- Current length of the buffer, in bytes.
◆ ptxBufferPool_Init()
Initialize the buffer pool. Allocate a number of buffers.
- Parameters
-
| [in,out] | bufPool | Uninitialized instance of buffer pool. |
| [in] | osAl | Pointer to an initialized OSAL component. |
| [in] | logCtx | Pointer to an initialized LOG component. |
| [in] | maxNumBuffers | Number of buffers to allocate. |
| [in] | memSize | Size of the buffers to allocate. |
| [in] | logDetails | Set to 1 to log details; with 0 no details are logged. |
- Returns
- Status of the operation. See definition of ptxStatus_t.
◆ ptxBufferPool_PointToLength()
Get the current buffer length pointer.
- Parameters
-
- Returns
- Address (pointer to) the variable that stores the current length.
◆ ptxBufferPool_ProvideAndClaimItem()
Combines the two functions Provide() and Claim().
See description and guidelines for each functions individually.
- Parameters
-
| [in] | bufPool | Initialized instance of buffer pool. |
| [in,out] | poolItem | Pointer to Pool Item. |
| [in] | sizeReq | Size of the buffer requested. |
- Returns
- Status of the operation. See definition of ptxStatus_t.
◆ ptxBufferPool_ProvideItem()
Provide a buffer that is currently not in use. Wait for a buffer to become free if there is currently none.
- Parameters
-
| [in] | bufPool | Initialized instance of buffer pool. |
| [in,out] | poolItem | Pointer to a location that will receive the address of a free buffer (or NULL if none is free). |
| [in] | sizeReq | Size of the buffer requested. |
- Returns
- Status of the operation. See definition of ptxStatus_t.
◆ ptxBufferPool_ReleaseItem()
Release an item and allow it to be garbage-collected.
- Parameters
-
- Returns
- Status of the operation. See definition of ptxStatus_t.
◆ ptxBufferPool_ReleaseUnusedItem()
Mark an unused buffer disposable.
Only if not used, a buffer is set to disposable state. This function has no effect on items in other states than Active ("provided", see ptxBufferPool_ProvideItem or ptxBufferPool_ProvideAndClaimItem) state.
- Parameters
-
- Returns
- Status of the operation. See definition of ptxStatus_t.