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
38 * Declaration of the composite pool.
39 * The composite pool managers a pool of composite objects. A composite object is an object
58 /****h* Component Library/Composite Pool
60 * Composite Pool
63 * The Composite Pool provides a self-contained and self-sustaining pool of
64 * user defined composite objects.
66 * A composite object is an object that is composed of one or more
67 * sub-objects, each of which needs to be treated separately for
69 * is memory in the system.
71 * To aid in object oriented design, the composite pool provides the user
76 * A composite pool does not return memory to the system as the user returns
80 * The composite pool functions operates on a cl_cpool_t structure which
100 /****d* Component Library: Composite Pool/cl_pfn_cpool_init_t
107 * composite pool.
112 (*cl_pfn_cpool_init_t) (IN void **const p_comp_array,
113 IN const uint32_t num_components, IN void *context);
117 * [in] Pointer to an object to initialize.
120 * [in] Context provided in a call to cl_cpool_init.
135 * to chain components to form a composite object and perform any necessary
138 * causes the initiating function to fail. Any non-CL_SUCCESS status will
141 * All memory for the requested number of components is pre-allocated.
147 * Composite Pool, cl_cpool_init, cl_cpool_grow
150 /****d* Component Library: Composite Pool/cl_pfn_cpool_dtor_t
157 * composite pool.
162 (*cl_pfn_cpool_dtor_t) (IN void *const p_object, IN void *context);
166 * [in] Pointer to an object to destruct.
169 * [in] Context provided in the call to cl_cpool_init.
181 * the memory for the composite object, as the composite pool manages
185 * Composite Pool, cl_cpool_init
188 /****s* Component Library: Composite Pool/cl_cpool_t
193 * Composite pool structure.
209 * Quick composite pool that manages all objects.
213 * to translate the quick composite pool's initializer callback to
214 * a composite pool initializer callback.
218 * to translate the quick composite pool's destructor callback to
219 * a composite pool destructor callback.
226 * Composite Pool
229 /****f* Component Library: Composite Pool/cl_cpool_construct
234 * The cl_cpool_construct function constructs a composite pool.
238 void cl_cpool_construct(IN cl_cpool_t * const p_pool);
242 * [in] Pointer to a cl_cpool_t structure whose state to initialize.
251 * composite pool function except cl_cpool_init.
254 * Composite Pool, cl_cpool_init, cl_cpool_destroy, cl_is_cpool_inited
257 /****f* Component Library: Composite Pool/cl_is_cpool_inited
262 * The cl_is_cpool_inited function returns whether a composite pool was
267 static inline boolean_t cl_is_cpool_inited(IN const cl_cpool_t * const p_pool) in cl_is_cpool_inited()
269 /* CL_ASSERT that a non-null pointer is provided. */ in cl_is_cpool_inited()
271 return (cl_is_qcpool_inited(&p_pool->qcpool)); in cl_is_cpool_inited()
277 * [in] Pointer to a cl_cpool_t structure whose initialization state
281 * TRUE if the composite pool was initialized successfully.
286 * Allows checking the state of a composite pool to determine if invoking
290 * Composite Pool
293 /****f* Component Library: Composite Pool/cl_cpool_init
298 * The cl_cpool_init function initializes a composite pool for use.
303 cl_cpool_init(IN cl_cpool_t * const p_pool,
304 IN const size_t min_size,
305 IN const size_t max_size,
306 IN const size_t grow_size,
307 IN size_t * const component_sizes,
308 IN const uint32_t num_components,
309 IN cl_pfn_cpool_init_t pfn_initializer OPTIONAL,
310 IN cl_pfn_cpool_dtor_t pfn_destructor OPTIONAL,
311 IN const void *const context);
315 * [in] Pointer to a cl_cpool_t structure to initialize.
318 * [in] Minimum number of objects that the pool should support. All
324 * [in] Maximum number of objects to which the pool is allowed to grow.
328 * [in] Number of objects to allocate when incrementally growing the pool.
332 * [in] Pointer to the first entry in an array of sizes describing,
333 * in order, the sizes of the components that make up a composite object.
336 * [in] Number of components that make up a composite object.
339 * [in] Initialization callback to invoke for every new object when
341 * stored in the composite pool consist of only one component.
346 * [in] Destructor callback to invoke for every object before memory for
352 * [in] Value to pass to the callback functions to provide context.
355 * CL_SUCCESS if the composite pool was initialized successfully.
358 * composite pool.
360 * CL_INVALID_SETTING if a NULL constructor was provided for composite objects
362 * the maximum size is non-zero and less than the minimum size.
372 * Composite Pool, cl_cpool_construct, cl_cpool_destroy,
378 /****f* Component Library: Composite Pool/cl_cpool_destroy
383 * The cl_cpool_destroy function destroys a composite pool.
387 static inline void cl_cpool_destroy(IN cl_cpool_t * const p_pool) in cl_cpool_destroy()
391 cl_qcpool_destroy(&p_pool->qcpool); in cl_cpool_destroy()
397 * [in] Pointer to a cl_cpool_t structure to destroy.
403 * All memory allocated for composite objects is freed. The destructor
405 * operations on the composite pool should not be attempted after
410 * In a debug build, cl_cpool_destroy asserts that all objects are in
414 * Composite Pool, cl_cpool_construct, cl_cpool_init
417 /****f* Component Library: Composite Pool/cl_cpool_count
423 * in a composite pool.
427 static inline size_t cl_cpool_count(IN cl_cpool_t * const p_pool) in cl_cpool_count()
430 return (cl_qcpool_count(&p_pool->qcpool)); in cl_cpool_count()
436 * [in] Pointer to a cl_cpool_t structure for which the number of
440 * Returns the number of objects available in the specified
441 * composite pool.
444 * Composite Pool
447 /****f* Component Library: Composite Pool/cl_cpool_get
453 * composite pool.
457 static inline void *cl_cpool_get(IN cl_cpool_t * const p_pool) in cl_cpool_get()
463 p_pool_obj = (cl_pool_obj_t *) cl_qcpool_get(&p_pool->qcpool); in cl_cpool_get()
467 CL_ASSERT(p_pool_obj->p_object); in cl_cpool_get()
468 return ((void *)p_pool_obj->p_object); in cl_cpool_get()
474 * [in] Pointer to a cl_cpool_t structure from which to retrieve
478 * Returns a pointer to the first component of a composite object.
488 * Composite Pool, cl_cpool_get_tail, cl_cpool_put, cl_cpool_grow,
492 /****f* Component Library: Composite Pool/cl_cpool_put
497 * The cl_cpool_put function returns an object to a composite pool.
502 cl_cpool_put(IN cl_cpool_t * const p_pool, IN void *const p_object) in cl_cpool_put()
511 (((uint8_t *) p_object) - sizeof(cl_pool_obj_t)); in cl_cpool_put()
514 CL_ASSERT(p_pool_obj->p_object == p_object); in cl_cpool_put()
516 cl_qcpool_put(&p_pool->qcpool, &p_pool_obj->pool_item); in cl_cpool_put()
522 * [in] Pointer to a cl_cpool_t structure to which to return
526 * [in] Pointer to the first component of an object to return to the pool.
538 * Composite Pool, cl_cpool_put_tail, cl_cpool_get
541 /****f* Component Library: Composite Pool/cl_cpool_grow
546 * The cl_cpool_grow function grows a composite pool by
552 cl_cpool_grow(IN cl_cpool_t * const p_pool, IN const uint32_t obj_count) in cl_cpool_grow()
555 return (cl_qcpool_grow(&p_pool->qcpool, obj_count)); in cl_cpool_grow()
561 * [in] Pointer to a cl_cpool_t structure whose capacity to grow.
564 * [in] Number of objects by which to grow the pool.
567 * CL_SUCCESS if the composite pool grew successfully.
570 * composite pool.
581 * Composite Pool