upipe/umem_pool.h header reference
Upipe pool-based memory allocator More
Header inclusion [link]
Members [link]
Functions [link]
- struct umem_mgr * umem_pool_mgr_alloc(size_t pool0_size, size_t nb_pools, ...)
- struct umem_mgr * umem_pool_mgr_alloc_simple(uint16_t base_pools_depth)
Description [link]
This memory allocator keeps released memory blocks in pools organized by power of 2's sizes, and reverts to malloc() and free() if the pool underflows or overflows.
Members detail [link]
#define _UPIPE_UMEM_POOL_H_ [link]
This macro is declared in upipe/umem_pool.h source file, line 34.
This function is declared in upipe/umem_pool.h source file, line 53.
This function allocates a new instance of the umem pool manager allocating buffers from application memory, using pools in power of 2's.
Parameter list:
- pool0_size: size (in octets) of the smallest allocatable buffer; it must be a power of 2
- nb_pools: number of buffer pools to maintain, with sizes in power of 2's increments, followed, for each pool, by the maximum number of buffers to keep in the pool (unsigned int); larger buffers will be directly managed with malloc() and free()
The return value is pointer to manager, or NULL in case of error
This function is declared in upipe/umem_pool.h source file, line 63.
This function allocates a new instance of the umem pool manager allocating buffers from application memory, using pools in power of 2's, with a simpler API.
Parameter list:
- base_pools_depth: number of buffers to keep in the pool for the smaller buffers; for larger buffers the same number is used, divided by 2, 4, or 8
The return value is pointer to manager, or NULL in case of error