Multi-ApplicationOnlineProfiling
2.1
|
This is an implementation of a Buffered FIFO data storage. More...
Modules | |
Internals | |
Not to be used directly. | |
Data Structures | |
struct | Buffered_FIFO |
This is a struct defining a FIFO It is composed of several Buffered_FIFO_chunk. More... | |
Functions | |
void | Buffered_FIFO_init (struct Buffered_FIFO *fifo, uint64_t chunk_size, size_t elem_size) |
Initializes a Buffered_FIFO. More... | |
void | Buffered_FIFO_release (struct Buffered_FIFO *fifo, void(*free_func)(void *)) |
releases a FIFO More... | |
void * | Buffered_FIFO_push (struct Buffered_FIFO *fifo, void *elem) |
Pushes an element into a FIFO. More... | |
void * | Buffered_FIFO_pop (struct Buffered_FIFO *fifo, void *dest) |
Pops an element from a FIFO. More... | |
uint64_t | Buffered_FIFO_count (struct Buffered_FIFO *fifo) |
Thread-safely gets the number of elements stored in the FIFO. More... | |
This is an implementation of a Buffered FIFO data storage.
The FIFO (Buffered_FIFO) is composed of several fixed size chunks (Buffered_FIFO_chunk).
Sample use:
Thus in this configuration and by definition of the FIFO, we pop elems in order (0,1,2).
uint64_t Buffered_FIFO_count | ( | struct Buffered_FIFO * | fifo | ) |
Thread-safely gets the number of elements stored in the FIFO.
fifo | the FIFO where to count elements |
Definition at line 23 of file Buffered_FIFO.c.
void Buffered_FIFO_init | ( | struct Buffered_FIFO * | fifo, |
uint64_t | chunk_size, | ||
size_t | elem_size | ||
) |
Initializes a Buffered_FIFO.
fifo | the FIFO to initialize |
chunk_size | the wanted size for the chunks |
elem_size | the size of stored elements |
Definition at line 119 of file Buffered_FIFO.c.
void* Buffered_FIFO_pop | ( | struct Buffered_FIFO * | fifo, |
void * | dest | ||
) |
Pops an element from a FIFO.
fifo | the FIFO from where to pop the element |
dest | where to copy the popped element |
Definition at line 182 of file Buffered_FIFO.c.
void* Buffered_FIFO_push | ( | struct Buffered_FIFO * | fifo, |
void * | elem | ||
) |
Pushes an element into a FIFO.
fifo | the FIFO where to push the element |
elem | the element to push |
Definition at line 143 of file Buffered_FIFO.c.
void Buffered_FIFO_release | ( | struct Buffered_FIFO * | fifo, |
void(*)(void *) | free_func | ||
) |
releases a FIFO
fifo | the FIFO to release |
free_func |
Definition at line 133 of file Buffered_FIFO.c.