|
Veritable Lasagna
An Allocator & Data Structure Library for C.
|
#include "vl_async_pool.h"
Include dependency graph for vl_async_pool.c:Macros | |
| #define | VL_ASYNC_POOL_BLOCK_MIN_SHIFT 4 |
| #define | VL_ASYNC_POOL_BLOCK_MIN (1 << VL_ASYNC_POOL_BLOCK_MIN_SHIFT) |
| #define | VL_ASYNC_POOL_BLOCK_MAX_SHIFT 16 |
| #define | VL_ASYNC_POOL_BLOCK_MAX (1 << VL_ASYNC_POOL_BLOCK_MAX_SHIFT) |
Functions | |
| void | vlAsyncPoolInitAligned (vl_async_pool *pool, vl_uint16_t elementSize, vl_uint16_t elementAlign) |
| Initializes the specified async pool, with the specified alignment. | |
| void | vlAsyncPoolFree (vl_async_pool *pool) |
| Frees the specified async pool, and all associated memory. | |
| vl_async_pool * | vlAsyncPoolNewAligned (vl_uint16_t elementSize, vl_uint16_t elementAlign) |
| Allocates and initializes a new async pool, and specified alignment. | |
| void | vlAsyncPoolDelete (vl_async_pool *pool) |
| Deinitializes and deletes the specified async pool, and all associated memory. | |
| void | vlAsyncPoolReset (vl_async_pool *pool) |
| Resets the specified async pool, returning it to its state when it was first initialized. | |
| void | vlAsyncPoolClear (vl_async_pool *pool) |
| Resets the state of all blocks and the pool, retaining memory but invalidating taken elements. | |
| void * | vlAsyncPoolTake (vl_async_pool *pool) |
| Takes an element from the specified async pool. | |
| void | vlAsyncPoolReturn (vl_async_pool *pool, void *element) |
| Returns an element to the specified async pool. | |
| #define VL_ASYNC_POOL_BLOCK_MAX (1 << VL_ASYNC_POOL_BLOCK_MAX_SHIFT) |
| #define VL_ASYNC_POOL_BLOCK_MAX_SHIFT 16 |
| #define VL_ASYNC_POOL_BLOCK_MIN (1 << VL_ASYNC_POOL_BLOCK_MIN_SHIFT) |
| #define VL_ASYNC_POOL_BLOCK_MIN_SHIFT 4 |
| void vlAsyncPoolClear | ( | vl_async_pool * | pool | ) |
Resets the state of all blocks and the pool, retaining memory but invalidating taken elements.
This does not free any associated memory.
| pool | pointer to the async pool to clear |
Here is the caller graph for this function:| void vlAsyncPoolDelete | ( | vl_async_pool * | pool | ) |
Deinitializes and deletes the specified async pool, and all associated memory.
The specified pool must have been initialized via vlAsyncPoolNew.
| pool | pointer to async pool to delete |
Here is the call graph for this function:| void vlAsyncPoolFree | ( | vl_async_pool * | pool | ) |
Frees the specified async pool, and all associated memory.
The pool must have been initialized via vlAsyncPoolInit.
| pool |
Here is the call graph for this function:
Here is the caller graph for this function:| void vlAsyncPoolInitAligned | ( | vl_async_pool * | pool, |
| vl_uint16_t | elementSize, | ||
| vl_uint16_t | elementAlign | ||
| ) |
Initializes the specified async pool, with the specified alignment.
The pool must be later freed via vlAsyncPoolFree.
pool memory. The pool manages its own internal blocks.vlAsyncPoolFree or vlAsyncPoolDelete.pool instance.pool must not be NULL.NULL.| pool | pointer to pool that will be initialized |
| elementSize | total size of a single element, in bytes. |
| elementAlign | byte alignment of pool elements. |
Here is the caller graph for this function:| vl_async_pool * vlAsyncPoolNewAligned | ( | vl_uint16_t | elementSize, |
| vl_uint16_t | elementAlign | ||
| ) |
Allocates and initializes a new async pool, and specified alignment.
The specified pool must later be deleted via vlAsyncPoolDelete.
| elementSize | total size of a single element, in bytes. |
| elementAlign | byte alignment of pool elements. |
Here is the call graph for this function:| void vlAsyncPoolReset | ( | vl_async_pool * | pool | ) |
Resets the specified async pool, returning it to its state when it was first initialized.
This frees all allocated blocks of nodes up to the first.
| pool | pointer to the async pool to reset |
Here is the call graph for this function:
Here is the caller graph for this function:| void vlAsyncPoolReturn | ( | vl_async_pool * | pool, |
| void * | element | ||
| ) |
Returns an element to the specified async pool.
| pool | pointer to async pool |
| element | pointer to returned element |
Here is the caller graph for this function:| void * vlAsyncPoolTake | ( | vl_async_pool * | pool | ) |
Takes an element from the specified async pool.
vlAsyncPoolReturn.NULL if a new block cannot be allocated when the pool is empty.NULL on heap allocation failure for new blocks.NULL.NULL on failure.| pool | pointer to async pool |
Here is the caller graph for this function: