upipe/upool.h header reference
Upipe pool of buffers, based on @ref ulifo More
Header inclusion
Members
Types
- struct upool
- typedef void *(*upool_alloc_cb)(struct upool *)
- typedef void (*upool_free_cb)(struct upool *, void *)
Functions
- void upool_clean(struct upool *upool)
- void upool_free(struct upool *upool, void *obj)
- void upool_init(struct upool *upool, struct urefcount *refcount, uint16_t length, void *extra, upool_alloc_cb alloc_cb, upool_free_cb free_cb)
- void upool_release(struct upool *upool)
- struct upool * upool_use(struct upool *upool)
- void upool_vacuum(struct upool *upool)
Macros
Description
Upipe pool of buffers, based on @ref ulifo
Members detail
This macro is declared in upipe/upool.h source file, line 31.
This struct is declared in upipe/upool.h source file, line 50.
This struct is the implementation of a pool of buffers.
Field | Description |
---|---|
struct urefcount * refcount; | pointer to refcount management structure |
struct ulifo lifo; | lifo |
upool_alloc_cb alloc_cb; | call-back to allocate new elements |
upool_free_cb free_cb; | call-back to release unused elements |
This macro is declared in upipe/upool.h source file, line 129.
This macro allocates an elements from the upool.
Parameter list:
- upool: pointer to a upool structure
- type: type of the opaque pointer
The return value is allocated element, or NULL in case of allocation error
typedef void *(*upool_alloc_cb)(struct upool *)
This typedef is declared in upipe/upool.h source file, line 45.
This typedef is a call-back to allocate new elements
void upool_clean(struct upool *upool)
This function is declared in upipe/upool.h source file, line 162.
This function empties and cleans up a upool.
Parameter list:
- upool: pointer to a upool structure
void upool_free(struct upool *upool, void *obj)
This function is declared in upipe/upool.h source file, line 138.
This function frees an element.
Parameter list:
- upool: pointer to a upool structure
- obj: element to free
typedef void (*upool_free_cb)(struct upool *, void *)
This typedef is declared in upipe/upool.h source file, line 47.
This typedef is a call-back to release unused elements
void upool_init(struct upool *upool, struct urefcount *refcount, uint16_t length, void *extra, upool_alloc_cb alloc_cb, upool_free_cb free_cb)
This function is declared in upipe/upool.h source file, line 79.
This function initializes a upool.
Parameter list:
- upool: pointer to a upool structure
- refcount: pointer to refcount management structure
- length: maximum number of elements in the pool
- extra: mandatory extra space allocated by the caller, with the size returned by upool_sizeof
void upool_release(struct upool *upool)
This function is declared in upipe/upool.h source file, line 104.
This function decrements the reference count of a upool or frees it.
Parameter list:
- upool: pointer to upool
This macro is declared in upipe/upool.h source file, line 65.
This macro returns the required size of extra data space for upool.
Parameter list:
- length: maximum number of elements in the LIFO
The return value is size in octets to allocate
This function is declared in upipe/upool.h source file, line 92.
This function increments the reference count of a upool.
Parameter list:
- upool: pointer to upool
The return value is same pointer to upool
void upool_vacuum(struct upool *upool)
This function is declared in upipe/upool.h source file, line 149.
This function empties a upool.
Parameter list:
- upool: pointer to a upool structure
void * upool_alloc_internal(struct upool *upool)
This function is for internal use only.
This function is declared in upipe/upool.h source file, line 115.
This function allocates an elements from the upool.
Parameter list:
- upool: pointer to a upool structure
The return value is allocated element, or NULL in case of allocation error