16 memset( ret, 0,
sizeof(
struct Trie_node ) );
36 if( tn->
size != size )
47 memcpy( tn->
payload, payload, size );
70 for( i = 0 ; i < 94 ; i++ )
77 memset( tn, 0,
sizeof(
struct Trie_node ) );
147 for( i = 0 ; i < 94 ; i++ )
static struct Trie_node * Trie_acquire_node(struct Trie *tr, char *key)
struct Trie_node * Trie_node_init_empty()
int Trie_node_set(struct Trie_node *tn, void *payload, size_t size)
void Trie_node_release(struct Trie_node *tn)
int MALP_Spinlock_unlock(MALP_Spinlock *mutex)
Unlocks the given MALP_Spinlock.
struct Trie_node * children[94]
static void Trie_relax_node(struct Trie_node *tn)
void Trie_delete(struct Trie *tr, char *key)
int Trie_init(struct Trie *tr)
void Trie_node_free_payload(struct Trie_node *tn)
int MALP_Spinlock_lock(MALP_Spinlock *mutex)
Locks the given MALP_Spinlock.
struct Trie_node * Trie_node_init_noalloc(void *payload, size_t size)
int Trie_set_no_alloc(struct Trie *tr, char *key, void *payload, size_t size)
int Trie_release(struct Trie *tr)
int _Trie_delete(struct Trie_node *tn, char *key, int depth)
int MALP_Spinlock_trylock(MALP_Spinlock *mutex)
Tries to lock the given MALP_Spinlock.
int Trie_set(struct Trie *tr, char *key, void *payload, size_t size)