]> pd.if.org Git - liblfds/blob - liblfds/liblfds7.1.0/liblfds710/src/lfds710_btree_addonly_unbalanced/lfds710_btree_addonly_unbalanced_init.c
Initial import (all versions, including the new 7.1.0)
[liblfds] / liblfds / liblfds7.1.0 / liblfds710 / src / lfds710_btree_addonly_unbalanced / lfds710_btree_addonly_unbalanced_init.c
1 /***** includes *****/
2 #include "lfds710_btree_addonly_unbalanced_internal.h"
3
4
5
6
7
8 /****************************************************************************/
9 void lfds710_btree_au_init_valid_on_current_logical_core( struct lfds710_btree_au_state *baus,
10                                                           int (*key_compare_function)(void const *new_key, void const *existing_key),
11                                                           enum lfds710_btree_au_existing_key existing_key,
12                                                           void *user_state )
13 {
14   LFDS710_PAL_ASSERT( baus != NULL );
15   LFDS710_PAL_ASSERT( (lfds710_pal_uint_t) &baus->root % LFDS710_PAL_ALIGN_SINGLE_POINTER == 0 );
16   LFDS710_PAL_ASSERT( key_compare_function != NULL );
17   // TRD : existing_key can be any value in its range
18   // TRD : user_state can be NULL
19
20   baus->root = NULL;
21   baus->key_compare_function = key_compare_function;
22   baus->existing_key = existing_key;
23   baus->user_state = user_state;
24
25   lfds710_misc_internal_backoff_init( &baus->insert_backoff );
26
27   LFDS710_MISC_BARRIER_STORE;
28
29   lfds710_misc_force_store();
30
31   return;
32 }
33