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 quick composite pool. The quick composite pool
39 * manages a pool of composite objects. A composite object is an object
59 /****h* Component Library/Quick Composite Pool
61 * Quick Composite Pool
64 * The Quick Composite Pool provides a self-contained and self-sustaining
65 * pool of user defined composite objects.
67 * A composite object is an object that is composed of one or more
68 * sub-objects, each of which needs to be treated separately for
70 * is memory in the system.
72 * To aid in object oriented design, the Quick Composite Pool provides users
77 * A Quick Composite Pool does not return memory to the system as the user
81 * The Quick Composite Pool operates on cl_pool_item_t structures that
82 * describe composite objects. This provides for more efficient memory use.
83 * If using a cl_pool_item_t is not desired, the Composite Pool provides
106 /****s* Component Library: Quick Composite Pool/cl_pool_item_t
128 * Used internally by the pool in debug builds to check for consistency.
131 * The pool item structure is defined in such a way as to safely allow
133 * retrieved from a quick pool in a quick list.
136 * Quick Composite Pool, cl_list_item_t
159 * Pointer to the user's object being stored in the pool.
162 * The pool object structure is used by non-quick pools to store object.
168 /****d* Component Library: Quick Composite Pool/cl_pfn_qcpool_init_t
175 * quick composite pool.
180 (*cl_pfn_qcpool_init_t) (IN void **const p_comp_array,
181 IN const uint32_t num_components,
182 IN void *context,
187 * [in] Pointer to the first entry in an array of pointers, each of
188 * which points to a component that makes up a composite object.
191 * [in] Number of components that in the component array.
194 * [in] Context provided in a call to cl_qcpool_init.
198 * structure that represents the composite object. This pointer must
214 * to chain components to form a composite object and perform any necessary
217 * and causes the initiating function to fail. Any non-CL_SUCCESS status
220 * All memory for the requested number of components is pre-allocated. Users
221 * should include space in one of their components for the cl_pool_item_t
222 * structure that will represent the composite object to avoid having to
223 * allocate that structure in the initialization callback. Alternatively,
227 * to the cl_pool_item_t returned by this function in the pp_pool_item
232 * Quick Composite Pool, cl_qcpool_init
235 /****d* Component Library: Quick Composite Pool/cl_pfn_qcpool_dtor_t
242 * quick composite pool.
247 (*cl_pfn_qcpool_dtor_t) (IN const cl_pool_item_t * const p_pool_item,
248 IN void *context);
252 * [in] Pointer to a cl_pool_item_t structure representing an object.
255 * [in] Context provided in a call to cl_qcpool_init.
267 * the memory for the composite object, as the quick composite pool manages
271 * Quick Composite Pool, cl_qcpool_init
274 /****s* Component Library: Quick Composite Pool/cl_qcpool_t
279 * Quick composite pool structure.
339 * Quick Composite Pool
342 /****f* Component Library: Quick Composite Pool/cl_qcpool_construct
347 * The cl_qcpool_construct function constructs a quick composite pool.
351 void cl_qcpool_construct(IN cl_qcpool_t * const p_pool);
355 * [in] Pointer to a cl_qcpool_t structure whose state to initialize.
364 * quick composite pool function except cl_qcpool_init.
367 * Quick Composite Pool, cl_qcpool_init, cl_qcpool_destroy,
371 /****f* Component Library: Quick Composite Pool/cl_is_qcpool_inited
376 * The cl_is_qcpool_inited function returns whether a quick composite pool was
381 static inline uint32_t cl_is_qcpool_inited(IN const cl_qcpool_t * const p_pool) in cl_is_qcpool_inited()
383 /* CL_ASSERT that a non-null pointer is provided. */ in cl_is_qcpool_inited()
385 /* CL_ASSERT that the pool is not in some invalid state. */ in cl_is_qcpool_inited()
386 CL_ASSERT(cl_is_state_valid(p_pool->state)); in cl_is_qcpool_inited()
388 return (p_pool->state == CL_INITIALIZED); in cl_is_qcpool_inited()
394 * [in] Pointer to a cl_qcpool_t structure to check.
397 * TRUE if the quick composite pool was initialized successfully.
402 * Allows checking the state of a quick composite pool to determine if
406 * Quick Composite Pool
409 /****f* Component Library: Quick Composite Pool/cl_qcpool_init
414 * The cl_qcpool_init function initializes a quick composite pool for use.
419 cl_qcpool_init(IN cl_qcpool_t * const p_pool,
420 IN const size_t min_size,
421 IN const size_t max_size,
422 IN const size_t grow_size,
423 IN const size_t * const component_sizes,
424 IN const uint32_t num_components,
425 IN cl_pfn_qcpool_init_t pfn_initializer OPTIONAL,
426 IN cl_pfn_qcpool_dtor_t pfn_destructor OPTIONAL,
427 IN const void *const context);
431 * [in] Pointer to a cl_qcpool_t structure to initialize.
434 * [in] Minimum number of objects that the pool should support. All
440 * [in] Maximum number of objects to which the pool is allowed to grow.
444 * [in] Number of objects to allocate when incrementally growing the pool.
448 * [in] Pointer to the first entry in an array of sizes describing,
449 * in order, the sizes of the components that make up a composite object.
452 * [in] Number of components that make up a composite object.
455 * [in] Initializer callback to invoke for every new object when growing
456 * the pool. This parameter may be NULL only if the objects stored in
457 * the quick composite pool consist of only one component. If NULL, the
463 * [in] Destructor callback to invoke for every object before memory for
469 * [in] Value to pass to the callback functions to provide context.
472 * CL_SUCCESS if the quick composite pool was initialized successfully.
475 * quick composite pool.
477 * CL_INVALID_SETTING if a NULL constructor was provided for composite objects
479 * the maximum size is non-zero and less than the minimum size.
484 * If initialization fails, the pool is left in a destroyed state. Callers
492 * Quick Composite Pool, cl_qcpool_construct, cl_qcpool_destroy,
497 /****f* Component Library: Quick Composite Pool/cl_qcpool_destroy
502 * The cl_qcpool_destroy function destroys a quick composite pool.
506 void cl_qcpool_destroy(IN cl_qcpool_t * const p_pool);
510 * [in] Pointer to a cl_qcpool_t structure to destroy.
516 * All memory allocated for composite objects is freed. The destructor
518 * operations on the composite pool should not be attempted after
524 * In a debug build, cl_qcpool_destroy asserts that all objects are in
528 * Quick Composite Pool, cl_qcpool_construct, cl_qcpool_init
531 /****f* Component Library: Quick Composite Pool/cl_qcpool_count
537 * in a quick composite pool.
541 static inline size_t cl_qcpool_count(IN cl_qcpool_t * const p_pool) in cl_qcpool_count()
544 CL_ASSERT(p_pool->state == CL_INITIALIZED); in cl_qcpool_count()
546 return (cl_qlist_count(&p_pool->free_list)); in cl_qcpool_count()
552 * [in] Pointer to a cl_qcpool_t structure for which the number of
556 * Returns the number of objects available in the specified
557 * quick composite pool.
560 * Quick Composite Pool
563 /****f* Component Library: Quick Composite Pool/cl_qcpool_get
569 * quick composite pool.
573 cl_pool_item_t *cl_qcpool_get(IN cl_qcpool_t * const p_pool);
577 * [in] Pointer to a cl_qcpool_t structure from which to retrieve
581 * Returns a pointer to a cl_pool_item_t for a composite object.
591 * Quick Composite Pool, cl_qcpool_get_tail, cl_qcpool_put,
595 /****f* Component Library: Quick Composite Pool/cl_qcpool_put
600 * The cl_qcpool_put function returns an object to a quick composite pool.
605 cl_qcpool_put(IN cl_qcpool_t * const p_pool, in cl_qcpool_put()
606 IN cl_pool_item_t * const p_pool_item) in cl_qcpool_put()
609 CL_ASSERT(p_pool->state == CL_INITIALIZED); in cl_qcpool_put()
612 CL_ASSERT(p_pool_item->p_pool == p_pool); in cl_qcpool_put()
615 cl_qlist_insert_head(&p_pool->free_list, &p_pool_item->list_item); in cl_qcpool_put()
621 * [in] Pointer to a cl_qcpool_t structure to which to return
625 * [in] Pointer to a cl_pool_item_t structure for the object
638 * Quick Composite Pool, cl_qcpool_put_tail, cl_qcpool_get
641 /****f* Component Library: Quick Composite Pool/cl_qcpool_put_list
647 * a quick composite pool.
652 cl_qcpool_put_list(IN cl_qcpool_t * const p_pool, IN cl_qlist_t * const p_list) in cl_qcpool_put_list()
659 CL_ASSERT(p_pool->state == CL_INITIALIZED); in cl_qcpool_put_list()
663 /* Chech that all items in the list came from this pool. */ in cl_qcpool_put_list()
666 CL_ASSERT(((cl_pool_item_t *) p_item)->p_pool == p_pool); in cl_qcpool_put_list()
672 cl_qlist_insert_list_head(&p_pool->free_list, p_list); in cl_qcpool_put_list()
678 * [in] Pointer to a cl_qcpool_t structure to which to return
682 * [in] Pointer to a cl_qlist_t structure for the list of objects
691 * The objects in the list specified by the p_list parameter must have been
695 * Quick Composite Pool, cl_qcpool_put, cl_qcpool_put_tail, cl_qcpool_get
698 /****f* Component Library: Quick Composite Pool/cl_qcpool_grow
703 * The cl_qcpool_grow function grows a quick composite pool by
708 cl_status_t cl_qcpool_grow(IN cl_qcpool_t * const p_pool, IN size_t obj_count);
712 * [in] Pointer to a cl_qcpool_t structure whose capacity to grow.
715 * [in] Number of objects by which to grow the pool.
718 * CL_SUCCESS if the quick composite pool grew successfully.
721 * quick composite pool.
732 * Quick Composite Pool