FreeBSD/sys/dev/isci/scil/sci_abstract_list.c
/**
 * Initialize the abstract list with its free pool
 *
 * @param[in] pool
 *    the free pool from which the elements will be extracted
 * @param[in] list_elements
 *    the array of list elements to be added to the free list
 * @param[in] element_count
 *    the count of the elements to be added to the free list these should be
 *    the same as the array size of list elements
 *
 * @return none
 */
Initialize the abstract list with its free pool
@param[in] pool
the free pool from which the elements will be extracted
@param[in] list_elements
the array of list elements to be added to the free list
@param[in] element_count
the count of the elements to be added to the free list these should be
the same as the array size of list elements

@return none
Initialize the abstract list with its free pool @param [ in ] pool the free pool from which the elements will be extracted @param [ in ] list_elements the array of list elements to be added to the free list @param [ in ] element_count the count of the elements to be added to the free list these should be the same as the array size of list elements @return none
void sci_abstract_element_pool_construct(
   SCI_ABSTRACT_ELEMENT_POOL_T * pool,
   SCI_ABSTRACT_ELEMENT_T      * list_elements,
   int                           element_count
)
{
   int index;
   memset(pool, 0, sizeof(SCI_ABSTRACT_ELEMENT_POOL_T));
   memset(list_elements, 0, sizeof(SCI_ABSTRACT_ELEMENT_T) * element_count);
   pool->elements     = list_elements;
   pool->max_elements = element_count;
   for (index = element_count - 1; index >= 0; index--)
   {
      private_pool_free(pool, &(list_elements[index]));
   }
}
void sci_abstract_element_pool_construct ( SCI_ABSTRACT_ELEMENT_POOL_T * pool , SCI_ABSTRACT_ELEMENT_T * list_elements , int element_count ) { int index ; memset ( pool , 0 , sizeof ( SCI_ABSTRACT_ELEMENT_POOL_T ) ) ; memset ( list_elements , 0 , sizeof ( SCI_ABSTRACT_ELEMENT_T ) * element_count ) ; pool -> elements = list_elements ; pool -> max_elements = element_count ; for ( index = element_count - 1 ; index >= 0 ; index -- ) { private_pool_free ( pool , & ( list_elements [ index ] ) ) ; } }
Initialize the abstract list with its free pool
 @param[in] pool
    the free pool from which the elements will be extracted
 @param[in] list_elements
    the array of list elements to be added to the free list
 @param[in] element_count
    the count of the elements to be added to the free list these should be
    the same as the array size of list elements
Initialize the abstract list with its free pool @param [ in ] pool the free pool from which the elements will be extracted @param [ in ] list_elements the array of list elements to be added to the free list @param [ in ] element_count the count of the elements to be added to the free list these should be the same as the array size of list elements
// Loop through all of the elements in the array and push them onto the // pool's free list.