function lfds710_freelist_query

From liblfds.org
Jump to navigation Jump to search

Source Files

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

Enums

enum lfds710_freelist_query
{
  LFDS710_FREELIST_QUERY_SINGLETHREADED_GET_COUNT,
  LFDS710_FREELIST_QUERY_SINGLETHREADED_VALIDATE,
  LFDS710_FREELIST_QUERY_GET_ELIMINATION_ARRAY_EXTRA_ELEMENTS_IN_FREELIST_ELEMENTS
};

Opaque Structures

struct lfds710_freelist_state;

Prototype

void lfds710_freelist_query( struct lfds710_freelist_state *ss,
                             enum lfds710_freelist_query query_type,
                             void *query_input,
                             void *query_output );

Parameters

struct lfds710_freelist_state *fs

A pointer to an initialized struct lfds710_freelist_state.

enum lfds710_freelist_query query_type

A single value from enum lfds710_freelist_query, which indicates which query to perform.

void *query_input

A pointer to input data for the query, where the data varies by query;
LFDS710_FREELIST_QUERY_SINGLETHREADED_GET_COUNT
query_input is NULL.
LFDS710_FREELIST_QUERY_SINGLETHREADED_VALIDATE
query_input can be NULL, or or can be a pointer to a struct lfds710_misc_validation_info, which specifies an expected min/max count, in which case validation also counts the number of elements and check they fall within the specified range.
LFDS710_FREELIST_QUERY_GET_ELIMINATION_ARRAY_EXTRA_ELEMENTS_IN_FREELIST_ELEMENTS
query_input is NULL.

void *query_output

A pointer to output store for the query, where the output varies by query;
LFDS710_FREELIST_QUERY_SINGLETHREADED_GET_COUNT
Points to a lfds710_pal_uint_t, which is set to the number of elements in the freelist.
LFDS710_FREELIST_QUERY_SINGLETHREADED_VALIDATE
Points to an enum lfds710_misc_validity, which is set to indicate the result of the validation operation.
LFDS710_FREELIST_QUERY_GET_ELIMINATION_ARRAY_EXTRA_ELEMENTS_IN_FREELIST_ELEMENTS
Points to a lfds710_pal_uint_t, which is set to the number of additional freelist elements required to account for the elimination layer.

Notes

All SINGLETHREADED queries can only be safely performed if no push or pop operations occur while the operation runs. If push or pop operations do occur during the execution of a SINGLETHREADED query, it is theoretically possible for the query to enter an infinite loop. Do not do this.

See Also