function lfds710_freelist_push

From liblfds.org
Jump to navigation Jump to search

Source Files

└───liblfds710
    ├───inc
    │   └───liblfds710
    │           lfds710_freelist.h
    └───src
        └───lfds710_freelist
                lfds710_freelist_push.c

Opaque Structures

struct lfds710_freelist_element;
struct lfds710_freelist_state;
struct lfds710_prng_st_state;

Prototype

void lfds710_freelist_push( struct lfds710_freelist_state *fs,
                            struct lfds710_freelist_element *fe,
                            struct lfds710_prng_st_state *psts );

Parameters

struct lfds710_freelist_state *fs

A pointer to an initialized struct lfds710_freelist_state.

struct lfds710_freelist_element *fe

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

struct lfds710_prng_st_state *psts

A pointer to a user-allocated struct lfds710_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.

Notes

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 LFDS710_FREELIST_SET_KEY_IN_ELEMENT and LFDS710_FREELIST_SET_VALUE_IN_ELEMENT respectively, and can only be set when a freelist element is outside of a freelist.

See Also