function lfds711_freelist_push

Jump to: navigation, search

Source Files

    │   └───liblfds711
    │           lfds711_freelist.h

Opaque Structures

struct lfds711_freelist_element;
struct lfds711_freelist_state;
struct lfds711_prng_st_state;


void lfds711_freelist_push( struct lfds711_freelist_state *fs,
                            struct lfds711_freelist_element *fe,
                            struct lfds711_prng_st_state *psts );


struct lfds711_freelist_state *fs

A pointer to an initialized struct lfds711_freelist_state.

struct lfds711_freelist_element *fe

A pointer to a user-allocated struct lfds711_freelist_element. There are no alignment requirements for this structure.

struct lfds711_prng_st_state *psts

A pointer to a user-allocated struct lfds711_prng_st_state. This argument is used by the elimination array to randomly select an element in the array. This argument can be NULL, in which case elimination array performance is degraded. If when initialized the freelist was given no elimination array, this argument is ignored as the elimination layer is not in use.


This function pushes a freelist element, with its key and value, onto the freelist. The key and value are both optional, are set by the macros LFDS711_FREELIST_SET_KEY_IN_ELEMENT and LFDS711_FREELIST_SET_VALUE_IN_ELEMENT respectively, and can only be set when a freelist element is outside of a freelist.

See Also