1 #include "lfds600_queue_internal.h"
7 /****************************************************************************/
8 void lfds600_queue_delete( struct lfds600_queue_state *qs, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state )
14 // TRD : user_data_delete_function can be NULL
15 // TRD : user_state can be NULL
17 while( lfds600_queue_dequeue(qs, &user_data) )
18 if( user_data_delete_function != NULL )
19 user_data_delete_function( user_data, user_state );
21 /* TRD : fully dequeuing will leave us
22 with a single dummy element
23 which both qs->enqueue and qs->dequeue point at
24 we push this back onto the lfds600_freelist
25 before we delete the lfds600_freelist
28 lfds600_freelist_push( qs->fs, qs->enqueue[LFDS600_QUEUE_POINTER]->fe );
30 lfds600_freelist_delete( qs->fs, lfds600_queue_internal_freelist_delete_function, NULL );
32 lfds600_abstraction_aligned_free( qs );
41 /****************************************************************************/
42 #pragma warning( disable : 4100 )
44 void lfds600_queue_internal_freelist_delete_function( void *user_data, void *user_state )
46 assert( user_data != NULL );
47 assert( user_state == NULL );
49 lfds600_abstraction_aligned_free( user_data );
54 #pragma warning( default : 4100 )