enum lfds710_list_asu_query

From liblfds.org
Jump to navigation Jump to search

Source File

└───liblfds710
    └───inc
        └───liblfds710
                lfds710_list_addonly_singlylinked_unordered.h

Enum

enum lfds710_list_asu_query
{
  LFDS710_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT,
  LFDS710_LIST_ASU_QUERY_SINGLETHREADED_VALIDATE
};

Values

LFDS710_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT

Counts the number of elements in the list. This query is and is only safe if performed single-threaded, i.e. that no insert operations occur while the count operation is executing. If insert 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 or access random addresses in memory. Don't do this.

LFDS710_LIST_ASU_QUERY_SINGLETHREADED_VALIDATE

Validates the list. This is done by checking there are no loops. Additionally, if given as input a lfds710_misc_validation_info, which indicates an expected range of the number of elements in the list, counts the number of elements in the list 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 LFDS710_LIST_ASU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT query) can in theory enter an infinite loop if insert operations occur while the validation operation is executing. You were warned.

Notes

This enum is used by the list query function, lfds710_list_asu_query.

See Also