Lines Matching +full:composite +full:- +full:in
3 * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
4 * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
9 * COPYING in the main directory of this source tree, or the
12 * Redistribution and use in source and binary forms, with or
16 * - Redistributions of source code must retain the above
20 * - Redistributions in binary form must reproduce the above
22 * disclaimer in the documentation and/or other materials
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
62 * The pool provides a self-contained and self-sustaining pool
65 * To aid in object oriented design, the pool provides the user
105 (*cl_pfn_pool_init_t) (IN void *const p_object, IN void *context);
109 * [in] Pointer to an object to initialize.
112 * [in] Context provided in a call to cl_pool_init.
130 * Any non-CL_SUCCESS status will be returned by the function that initiated
149 (*cl_pfn_pool_dtor_t) (IN void *const p_object, IN void *context);
153 * [in] Pointer to an object to destruct.
156 * [in] Context provided in the call to cl_pool_init.
196 * Quick composite pool that manages all objects.
200 * to translate the quick composite pool's initializer callback to
205 * to translate the quick composite pool's destructor callback to
225 void cl_pool_construct(IN cl_pool_t * const p_pool);
229 * [in] Pointer to a cl_pool_t structure whose state to initialize.
254 static inline uint32_t cl_is_pool_inited(IN const cl_pool_t * const p_pool) in cl_is_pool_inited()
256 /* CL_ASSERT that a non-null pointer is provided. */ in cl_is_pool_inited()
258 return (cl_is_qcpool_inited(&p_pool->qcpool)); in cl_is_pool_inited()
264 * [in] Pointer to a cl_pool_t structure whose initialization state
290 cl_pool_init(IN cl_pool_t * const p_pool,
291 IN const size_t min_count,
292 IN const size_t max_count,
293 IN const size_t grow_size,
294 IN const size_t object_size,
295 IN cl_pfn_pool_init_t pfn_initializer OPTIONAL,
296 IN cl_pfn_pool_dtor_t pfn_destructor OPTIONAL,
297 IN const void *const context);
301 * [in] Pointer to a cl_pool_t structure to initialize.
304 * [in] Minimum number of objects that the pool should support. All
310 * [in] Maximum number of objects to which the pool is allowed to grow.
314 * [in] Number of objects to allocate when incrementally growing the pool.
318 * [in] Size, in bytes, of each object.
321 * [in] Initialization callback to invoke for every new object when
327 * [in] Destructor callback to invoke for every object before memory for
333 * [in] Value to pass to the callback functions to provide context.
341 * CL_INVALID_SETTING if a the maximum size is non-zero and less than the
366 static inline void cl_pool_destroy(IN cl_pool_t * const p_pool) in cl_pool_destroy()
369 cl_qcpool_destroy(&p_pool->qcpool); in cl_pool_destroy()
375 * [in] Pointer to a cl_pool_t structure to destroy.
389 * In a debug build, cl_pool_destroy asserts that all objects are in
402 * in a pool.
406 static inline size_t cl_pool_count(IN cl_pool_t * const p_pool) in cl_pool_count()
409 return (cl_qcpool_count(&p_pool->qcpool)); in cl_pool_count()
415 * [in] Pointer to a cl_pool_t structure for which the number of
419 * Returns the number of objects available in the specified pool.
434 static inline void *cl_pool_get(IN cl_pool_t * const p_pool) in cl_pool_get()
440 p_pool_obj = (cl_pool_obj_t *) cl_qcpool_get(&p_pool->qcpool); in cl_pool_get()
444 CL_ASSERT(p_pool_obj->p_object); in cl_pool_get()
445 return ((void *)p_pool_obj->p_object); in cl_pool_get()
451 * [in] Pointer to a cl_pool_t structure from which to retrieve
478 cl_pool_put(IN cl_pool_t * const p_pool, IN void *const p_object) in cl_pool_put()
487 (((uint8_t *) p_object) - sizeof(cl_pool_obj_t)); in cl_pool_put()
490 CL_ASSERT(p_pool_obj->p_object == p_object); in cl_pool_put()
492 cl_qcpool_put(&p_pool->qcpool, &p_pool_obj->pool_item); in cl_pool_put()
498 * [in] Pointer to a cl_pool_t structure to which to return
502 * [in] Pointer to an object to return to the pool.
528 cl_pool_grow(IN cl_pool_t * const p_pool, IN const size_t obj_count) in cl_pool_grow()
531 return (cl_qcpool_grow(&p_pool->qcpool, obj_count)); in cl_pool_grow()
537 * [in] Pointer to a cl_pool_t structure whose capacity to grow.
540 * [in] Number of objects by which to grow the pool.