enum lfds700_freelist_query

From liblfds.org
Revision as of 03:00, 25 December 2015 by Admin (talk | contribs) (→‎Values)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Source File

└───liblfds700
    └───inc
        └───liblfds700
                lfds700_freelist.h

Enum

enum lfds700_freelist_query
{
  LFDS700_FREELIST_QUERY_SINGLETHREADED_GET_COUNT,
  LFDS700_FREELIST_QUERY_SINGLETHREADED_VALIDATE
};

Values

LFDS700_FREELIST_QUERY_SINGLETHREADED_GET_COUNT

Counts the number of elements in the freelist. This query is and is only safe if performed single-threaded, i.e. that no push or pop operations occur while the count operation is executing. If push or pop operations occur, it is not merely the case that the count could be wrong - in theory, it could be possible for the count to enter an infinite loop. Don't do this.

LFDS700_FREELIST_QUERY_SINGLETHREADED_VALIDATE

Validates the freelist. This is done by checking there are no loops. Additionally, if given as input a lfds700_misc_validation_info, which indicates an expected range of the number of elements in the freelist, counts the number of elements in the freelist and checks they fall within the expected range. As with count, both the loop check and the element count (which is in fact performed by issuing the LFDS700_FREELIST_QUERY_SINGLETHREADED_GET_COUNT query) can in theory enter an infinite loop if push or pop operations occur while the validation operation is executing. You were warned.

Notes

This enum is used by the freelist query function, lfds700_freelist_query.

See Also