function lfds711_freelist_push

From liblfds.org
Jump to navigation Jump to search

Source Files

└───liblfds711
    ├───inc
    │   └───liblfds711
    │           lfds711_freelist.h
    └───src
        └───lfds711_freelist
                lfds711_freelist_push.c

Opaque Structures

struct lfds711_freelist_element;
struct lfds711_freelist_state;
struct lfds711_prng_st_state;

Prototype

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

Parameters

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.

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 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