Multi-ApplicationOnlineProfiling
2.1
|
Not to be used directly. More...
Data Structures | |
struct | chained_list |
Basic buffered chained list. More... | |
struct | chained_list_view |
This struct is used to improve performance when sequentially walking through. More... | |
Functions | |
struct chained_list * | chained_list_init (uint32_t size_of_trunk, size_t size_of_payload) |
Ininitalizes a buffered chained list. More... | |
void | chained_list_release (struct chained_list **list) |
Release a buffered chained list. More... | |
struct chained_list * | chained_list_alloc_next_chunk (struct chained_list *current_chunk) |
Alocate a new chunk pointing to current_chunk (Recopy MODE ) More... | |
struct chained_list * | chained_list_alloc_chunk (uint32_t size_of_trunk, size_t size_of_payload) |
Alocate a new chunk ( first chunk ) More... | |
int | chained_list_count (struct chained_list *list) |
Count elements in the chained list. More... | |
void * | chained_list_push (struct chained_list **list, void *p_payload) |
Push an element in the chained list. More... | |
void | cond_chained_list_merge (struct chained_list **dest, struct chained_list *source, int(*condition)(void *)) |
Push all element of source satisfying condition in dest. More... | |
void | chained_list_walkthrough (struct chained_list *list, void(*action)(void *)) |
Call a function uppon each element of the chained list. More... | |
void | chained_list_walkthrough_arg (struct chained_list *list, void(*action)(void *, void *), void *arg) |
Call a function uppon each element of the chained list. More... | |
static void | chained_list_view_init (struct chained_list_view *clv) |
Initializes a chained_list_view. More... | |
void * | chained_list_get_elem (struct chained_list *list, int(*test_func)(void *, void *), void *value) |
Get a pointer to the first element which matches a value. More... | |
static void * | chained_list_get_nth (struct chained_list *list, uint64_t n) |
Get a reference to the nth element of the chained list. More... | |
static void * | chained_list_get_nth_seq (struct chained_list *list, struct chained_list_view *view, uint64_t n) |
Get a reference to the nth element of the chained list (optimised for sequential) More... | |
Not to be used directly.
These structure and functions are not meant to be used directly. These are internals of Chained List and related functions.
struct chained_list* chained_list_alloc_chunk | ( | uint32_t | size_of_trunk, |
size_t | size_of_payload | ||
) |
Alocate a new chunk ( first chunk )
size_of_trunk | in number of elems |
size_of_payload | elem eg sizeof( TYPE ) |
Definition at line 38 of file Chained_List.c.
struct chained_list* chained_list_alloc_next_chunk | ( | struct chained_list * | current_chunk | ) |
Alocate a new chunk pointing to current_chunk (Recopy MODE )
current_chunk | pointer to current_chunk |
Definition at line 26 of file Chained_List.c.
int chained_list_count | ( | struct chained_list * | list | ) |
Count elements in the chained list.
list | pointer to an initialized chained list |
Definition at line 151 of file Chained_List.c.
void* chained_list_get_elem | ( | struct chained_list * | list, |
int(*)(void *, void *) | test_func, | ||
void * | value | ||
) |
Get a pointer to the first element which matches a value.
list | pointer to a chained list list |
test_func | comparison function |
value | the wanted value |
Definition at line 185 of file Chained_List.c.
|
inlinestatic |
Get a reference to the nth element of the chained list.
list | pointer to a chained list |
n | element index |
Definition at line 165 of file Chained_List.h.
|
inlinestatic |
Get a reference to the nth element of the chained list (optimised for sequential)
list | pointer to a chained list list |
view | enhance sequential walking of the list by storing last chunk |
n | element index |
This function must be used in case the elements are get sequentially.
The chunk of the last found item is stored int view and the search starts from it, so the next call found next element much faster (especially when the list is hugh).
Definition at line 207 of file Chained_List.h.
struct chained_list* chained_list_init | ( | uint32_t | size_of_trunk, |
size_t | size_of_payload | ||
) |
Ininitalizes a buffered chained list.
size_of_trunk | size of the trunk in number of elems |
size_of_payload | size of a payload elem eg sizeof( TYPE ) |
Definition at line 21 of file Chained_List.c.
void* chained_list_push | ( | struct chained_list ** | list, |
void * | p_payload | ||
) |
Push an element in the chained list.
list | double Pointer to an initialized chained list ( may be modified uppon push ) |
p_payload | pointer to the elem |
Definition at line 62 of file Chained_List.c.
void chained_list_release | ( | struct chained_list ** | list | ) |
Release a buffered chained list.
list | double pointer on a chained_list (set to NULL uppon release ) |
Definition at line 167 of file Chained_List.c.
|
inlinestatic |
Initializes a chained_list_view.
clv | the list view to initialize |
Definition at line 142 of file Chained_List.h.
void chained_list_walkthrough | ( | struct chained_list * | list, |
void(*)(void *) | action | ||
) |
Call a function uppon each element of the chained list.
list | pointer to a chained list list |
action | function (takes element in param as void *) |
Definition at line 116 of file Chained_List.c.
void chained_list_walkthrough_arg | ( | struct chained_list * | list, |
void(*)(void *, void *) | action, | ||
void * | arg | ||
) |
Call a function uppon each element of the chained list.
list | pointer to a chained list list |
action | function (takes element in param as void *) |
arg | arguments to give to action (second void*) |
Definition at line 134 of file Chained_List.c.
void cond_chained_list_merge | ( | struct chained_list ** | dest, |
struct chained_list * | source, | ||
int(*)(void *) | condition | ||
) |
Push all element of source satisfying condition in dest.
dest | pointer to destination list |
source | pointer to source list |
condition | test function (takes a source elem as param) returns 1 for mergin |
Definition at line 91 of file Chained_List.c.