2 #include "lfds700_hash_addonly_internal.h"
4 /***** private prototypes*****/
5 static void btree_au_element_cleanup_function( struct lfds700_btree_au_state *baus, struct lfds700_btree_au_element *baue );
11 /****************************************************************************/
12 void lfds700_hash_a_cleanup( struct lfds700_hash_a_state *has,
13 void (*element_cleanup_callback)(struct lfds700_hash_a_state *has, struct lfds700_hash_a_element *hae) )
18 LFDS700_PAL_ASSERT( has != NULL );
19 // TRD : element_cleanup_callback can be NULL
21 if( element_cleanup_callback == NULL )
24 LFDS700_MISC_BARRIER_LOAD;
26 has->element_cleanup_callback = element_cleanup_callback;
28 for( loop = 0 ; loop < has->array_size ; loop++ )
29 lfds700_btree_au_cleanup( has->baus_array+loop, btree_au_element_cleanup_function );
38 /****************************************************************************/
39 #pragma warning( disable : 4100 )
41 static void btree_au_element_cleanup_function( struct lfds700_btree_au_state *baus, struct lfds700_btree_au_element *baue )
43 struct lfds700_hash_a_state
46 struct lfds700_hash_a_element
49 LFDS700_PAL_ASSERT( baus != NULL );
50 LFDS700_PAL_ASSERT( baue != NULL );
52 hae = (struct lfds700_hash_a_element *) LFDS700_BTREE_AU_GET_VALUE_FROM_ELEMENT( *baue );
53 has = (struct lfds700_hash_a_state *) LFDS700_BTREE_AU_GET_USER_STATE_FROM_STATE( *baus );
55 has->element_cleanup_callback( has, hae );
60 #pragma warning( default : 4100 )