Multi-ApplicationOnlineProfiling  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Internals

Not to be used directly. More...

Data Structures

struct  Buffered_LIFO_chunk
 Structure defining a chunk of LIFO. A buffered lifo consists in several chunks which are stacked in a lifo fashion. Moreover those chunks gather several elems in order to avoid alocation and dealocation plus it reduces the pointer versus data ratio for small amount of data. More...
 

Functions

struct Buffered_LIFO_chunkBuffered_LIFO_chunk_new (size_t sizeof_payload, uint64_t chunk_size, struct Buffered_LIFO_chunk *prev)
 Allocates an empty Buffered_LIFO_chunk pointing to prev. More...
 
void Buffered_LIFO_chunk_release (struct Buffered_LIFO_chunk *chunk, size_t sizeof_payload, void(*free_func)(void *))
 Releases a Buffered_LIFO_chunk note that it does not recurses over previous chunks. More...
 
struct Buffered_LIFO_chunkBuffered_LIFO_chunk_push (struct Buffered_LIFO_chunk *chunk, void *elem, size_t sizeof_payload, uint64_t chunk_size)
 Push a new elem in the Buffered_LIFO_chunk. More...
 
struct Buffered_LIFO_chunkBuffered_LIFO_chunk_pop (struct Buffered_LIFO_chunk *chunk, size_t sizeof_payload, uint64_t chunk_size, void *elem, int *did_ret)
 Get an element from the Buffered_LIFO_chunk. More...
 
void * Buffered_LIFO_chunk_head (struct Buffered_LIFO_chunk *chunk, size_t sizeof_payload)
 Get a pointer to the Buffered_LIFO_chunk head eleme (NULL if none) More...
 

Detailed Description

Not to be used directly.

These structure and functions are not meant to be used directly. These are internals of Buffered LIFO and related functions.

Function Documentation

void* Buffered_LIFO_chunk_head ( struct Buffered_LIFO_chunk chunk,
size_t  sizeof_payload 
)

Get a pointer to the Buffered_LIFO_chunk head eleme (NULL if none)

Parameters
chunkChunk from which we want to get the head
Returns
A pointer to current chunk head (NULL if none)

Definition at line 117 of file Buffered_LIFO.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct Buffered_LIFO_chunk* Buffered_LIFO_chunk_new ( size_t  sizeof_payload,
uint64_t  chunk_size,
struct Buffered_LIFO_chunk prev 
)

Allocates an empty Buffered_LIFO_chunk pointing to prev.

Parameters
sizeof_payloadsize of a payload element to compute piggy backing stored in the LIFO to gain space
chunk_sizethe number of elements the chunk can contain
prevpointer to the previous Buffered_LIFO_chunk in order to chain them
Returns
A pointer to the newly allocated chunk

Definition at line 23 of file Buffered_LIFO.c.

Here is the caller graph for this function:

struct Buffered_LIFO_chunk* Buffered_LIFO_chunk_pop ( struct Buffered_LIFO_chunk chunk,
size_t  sizeof_payload,
uint64_t  chunk_size,
void *  elem,
int *  did_ret 
)

Get an element from the Buffered_LIFO_chunk.

Parameters
chunkChunk to which we want to add an elem (can be NULL and then leads to did_ret == 0 )
sizeof_payloadsize of a payload element
chunk_sizethe number of elements the chunk can contain
did_retboolean which allows us to know if we actually retrieved an elem from the LIFO
Returns
A pointer to current chunk (can change if a chunk had been freed)

Definition at line 88 of file Buffered_LIFO.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct Buffered_LIFO_chunk* Buffered_LIFO_chunk_push ( struct Buffered_LIFO_chunk chunk,
void *  elem,
size_t  sizeof_payload,
uint64_t  chunk_size 
)

Push a new elem in the Buffered_LIFO_chunk.

Parameters
chunkChunk to which we want to add an elem (can be NULL and then leads to a chunk allocation)
sizeof_payloadsize of a payload element
chunk_sizethe number of elements the chunk can contain
Returns
A pointer to current chunk (can change if a new one had been allocated)

Definition at line 62 of file Buffered_LIFO.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void Buffered_LIFO_chunk_release ( struct Buffered_LIFO_chunk chunk,
size_t  sizeof_payload,
void(*)(void *)  free_func 
)

Releases a Buffered_LIFO_chunk note that it does not recurses over previous chunks.

Parameters
chunkChunk to be released
sizeof_payloadsize of a payload element
free_funca function to be called over each elem still present in the FIFO (NULL if node)

Definition at line 39 of file Buffered_LIFO.c.

Here is the caller graph for this function: