function lfds711_freelist_cleanup

From liblfds.org
Revision as of 18:11, 16 February 2017 by Admin (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Source Files

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

Opaque Structures

struct lfds711_freelist_element;
struct lfds711_freelist_state;

Prototype

void lfds711_freelist_cleanup( struct lfds711_freelist_state *fs,
                               void (*element_cleanup_callback)(struct lfds711_freelist_state *fs, struct lfds711_freelist_element *fe) );

Parameters

struct lfds711_freelist_state *fs

A pointer to an initialized struct lfds711_freelist_state.

void (*element_cleanup_callback)(struct lfds711_freelist_state *fs, struct lfds711_freelist_element *fe)

A callback function which is called with every element present in the freelist at the time of cleanup. This argument can be NULL.

Notes

The cleanup function actually does no work except, if the callback function is provided, to make all pushed freelist elements valid for the current logical core and to iterate over the freelist and pass each element to the callback function.

The user can in the callback function use the LFDS711_FREELIST_GET_USER_STATE_FROM_STATE macro on the freelist state to get hold of the user state provided when the freelist was initialized.

See Also