2 #include "lfds710_hash_addonly_internal.h"
4 /***** private prototypes*****/
5 static void btree_au_element_cleanup_function( struct lfds710_btree_au_state *baus,
6 struct lfds710_btree_au_element *baue );
12 /****************************************************************************/
13 void lfds710_hash_a_cleanup( struct lfds710_hash_a_state *has,
14 void (*element_cleanup_callback)(struct lfds710_hash_a_state *has, struct lfds710_hash_a_element *hae) )
19 LFDS710_PAL_ASSERT( has != NULL );
20 // TRD : element_cleanup_callback can be NULL
22 if( element_cleanup_callback == NULL )
25 LFDS710_MISC_BARRIER_LOAD;
27 has->element_cleanup_callback = element_cleanup_callback;
29 for( loop = 0 ; loop < has->array_size ; loop++ )
30 lfds710_btree_au_cleanup( has->baus_array+loop, btree_au_element_cleanup_function );
39 /****************************************************************************/
40 #pragma warning( disable : 4100 )
42 static void btree_au_element_cleanup_function( struct lfds710_btree_au_state *baus,
43 struct lfds710_btree_au_element *baue )
45 struct lfds710_hash_a_state
48 struct lfds710_hash_a_element
51 LFDS710_PAL_ASSERT( baus != NULL );
52 LFDS710_PAL_ASSERT( baue != NULL );
54 hae = (struct lfds710_hash_a_element *) LFDS710_BTREE_AU_GET_VALUE_FROM_ELEMENT( *baue );
55 has = (struct lfds710_hash_a_state *) LFDS710_BTREE_AU_GET_USER_STATE_FROM_STATE( *baus );
57 has->element_cleanup_callback( has, hae );
62 #pragma warning( default : 4100 )