22 #define KEY_ENTRY_CL_COLL_AVOID 5
196 if( (*tmp)->type == type )
230 if( (handler)( *tmp, arg ) )
struct Chained_List target_ks
the list of Knowledge_system identified by this key entry
This struct is used to improve performance when sequentially walking through.
static void chained_list_view_init(struct chained_list_view *clv)
Initializes a chained_list_view.
#define KEY_ENTRY_CL_COLL_AVOID
The Knowledge_system structure.
void Key_entry_push_ks(struct Key_entry *ke, struct Knowledge_system *ks)
associates a Knowledge_system to a key entry
uint64_t count
the number of elements in the list
void Key_entry_clear_ks(struct Key_entry *ke)
Clear all references to Ks in this entry.
void Key_entry_pop_ks(struct Key_entry *ke, struct Knowledge_system *ks)
Removes an association between a Knowledge_system and its key.
static void Chained_List_init(struct Chained_List *list, uint64_t chunk_size, size_t payload_size)
Initializes a Chained_List.
uint64_t key
the key identifier
int MALP_Spinlock_unlock(MALP_Spinlock *mutex)
Unlocks the given MALP_Spinlock.
MALP_Spinlock lock
a lock for concurrent access
void Key_entry_init(struct Key_entry *ke, uint64_t key)
Init a key entry with given key.
void Key_entry_walk(struct Key_entry *ke, int(*handler)(struct Knowledge_system *, void *), void *arg)
Call a handler on every Ks of a key entry.
static void * Chained_List_push(struct Chained_List *list, void *payload)
Adds an element to the list.
int MALP_Spinlock_lock(MALP_Spinlock *mutex)
Locks the given MALP_Spinlock.
int Key_entry_has_KS_type(struct Key_entry *ke, uint64_t type)
Check if a KS type is present in a key entry.
struct Knowledge_system ** Key_entry_get_ks(struct Key_entry *ke, struct Knowledge_system *ks)
Search in the key entry if a Knowledge_system is associated with it.
static void Chained_List_release(struct Chained_List *list)
Clears a Chained_List.
struct Knowledge_system ** Key_entry_find_empty(struct Key_entry *ke)
void Key_entry_release(struct Key_entry *ke)
Clears a key entry.
uint8_t freed
set to one when the entry is released, 0 otherwise
static void * Chained_List_get_nth_seq(struct Chained_List *cl, struct chained_list_view *view, uint64_t n)
Get a reference to the nth element of the chained list (optimised for sequential) ...
int Key_entry_get_count(struct Key_entry *ke)
Get the number of Ks in this entry.