comparison libcore/core/alloc.h @ 237:1bf5bd306bb0

core: add alloc_pool_get function
author David Demelier <markand@malikania.fr>
date Fri, 27 Nov 2020 13:31:27 +0100
parents 2734223d3daf
children
comparison
equal deleted inserted replaced
236:4896bb07a8db 237:1bf5bd306bb0
233 */ 233 */
234 void * 234 void *
235 alloc_pool_new(struct alloc_pool *pool); 235 alloc_pool_new(struct alloc_pool *pool);
236 236
237 /** 237 /**
238 * Get the value at the given index.
239 *
240 * \pre pool != NULL
241 * \pre index < pool->size
242 * \param pool the pool
243 * \param index the object index
244 * \return The pointer to the region.
245 */
246 void *
247 alloc_pool_get(const struct alloc_pool *pool, size_t index);
248
249 /**
238 * Finalize the pool and all individual element if a finalizer is set. 250 * Finalize the pool and all individual element if a finalizer is set.
239 * 251 *
240 * You must call \ref alloc_pool_init again before reusing it. 252 * You must call \ref alloc_pool_init again before reusing it.
241 * 253 *
242 * \pre pool != NULL 254 * \pre pool != NULL