|
fr_lst_t * | _fr_lst_alloc (TALLOC_CTX *ctx, fr_lst_cmp_t cmp, char const *type, size_t offset, fr_lst_index_t init) |
|
static void | _fr_lst_extract (fr_lst_t *lst, stack_index_t stack_index, void *data) |
|
static void | _fr_lst_insert (fr_lst_t *lst, stack_index_t stack_index, void *data) |
|
static void * | _fr_lst_peek (fr_lst_t *lst, stack_index_t stack_index) |
|
static void * | _fr_lst_pop (fr_lst_t *lst, stack_index_t stack_index) |
|
static void | bucket_add (fr_lst_t *lst, stack_index_t stack_index, void *data) |
| Add data to the bucket of a specified (sub)tree.
|
|
static void | bucket_delete (fr_lst_t *lst, stack_index_t stack_index, void *data) |
|
static fr_lst_index_t | bucket_lwb (fr_lst_t const *lst, stack_index_t stack_index) |
|
static fr_lst_index_t | bucket_upb (fr_lst_t const *lst, stack_index_t stack_index) |
|
int | fr_lst_extract (fr_lst_t *lst, void *data) |
| Remove an element from an LST.
|
|
int | fr_lst_insert (fr_lst_t *lst, void *data) |
|
void * | fr_lst_iter_init (fr_lst_t *lst, fr_lst_iter_t *iter) |
| Iterate over entries in LST.
|
|
void * | fr_lst_iter_next (fr_lst_t *lst, fr_lst_iter_t *iter) |
| Get the next entry in an LST.
|
|
unsigned int | fr_lst_num_elements (fr_lst_t *lst) |
|
void * | fr_lst_peek (fr_lst_t *lst) |
|
void * | fr_lst_pop (fr_lst_t *lst) |
|
void | fr_lst_verify (char const *file, int line, fr_lst_t const *lst) |
|
static void * | index_addr (fr_lst_t const *lst, void *data) |
|
static fr_lst_index_t | index_reduce (fr_lst_t const *lst, fr_lst_index_t idx) |
|
static bool | is_bucket (fr_lst_t const *lst, stack_index_t idx) |
|
static bool | is_equivalent (fr_lst_t const *lst, fr_lst_index_t idx1, fr_lst_index_t idx2) |
|
static void * | item (fr_lst_t const *lst, fr_lst_index_t idx) |
|
static fr_lst_index_t | item_index (fr_lst_t const *lst, void *data) |
|
static void | item_index_set (fr_lst_t *lst, void *data, fr_lst_index_t idx) |
|
static void | item_set (fr_lst_t *lst, fr_lst_index_t idx, void *data) |
|
static bool | lst_expand (fr_lst_t *lst) |
| Make more space available in an LST.
|
|
static void | lst_flatten (fr_lst_t *lst, stack_index_t stack_index) |
| Flatten an LST, i.e.
|
|
static void | lst_indices_reduce (fr_lst_t *lst) |
| Reduce pivot stack indices based on their difference from lst->idx, and then reduce lst->idx.
|
|
static stack_index_t | lst_length (fr_lst_t const *lst, stack_index_t stack_index) |
| The length function for LSTs (how many buckets it contains)
|
|
static void | lst_move (fr_lst_t *lst, fr_lst_index_t location, void *data) |
| Move data to a specific location in an LST's array.
|
|
static fr_lst_index_t | lst_size (fr_lst_t *lst, stack_index_t stack_index) |
| The size function for LSTs (number of items a (sub)tree contains)
|
|
static void | partition (fr_lst_t *lst, stack_index_t stack_index) |
|
static void * | pivot_item (fr_lst_t const *lst, stack_index_t idx) |
|
static fr_lst_index_t | raw_item_index (fr_lst_t const *lst, void *data) |
|
static stack_index_t | stack_depth (pivot_stack_t const *s) |
|
static bool | stack_expand (fr_lst_t *lst, pivot_stack_t *s) |
|
static fr_lst_index_t | stack_item (pivot_stack_t const *s, stack_index_t idx) |
|
static void | stack_pop (pivot_stack_t *s, unsigned int n) |
|
static int | stack_push (fr_lst_t *lst, pivot_stack_t *s, fr_lst_index_t pivot) |
|
static void | stack_set (pivot_stack_t *s, stack_index_t idx, fr_lst_index_t new_value) |
|
Functions for a Leftmost Skeleton Tree.
- Copyright
- 2021 Network RADIUS SAS (legal.nosp@m.@net.nosp@m.workr.nosp@m.adiu.nosp@m.s.com)
Definition in file lst.c.
Make more space available in an LST.
The LST paper only mentions this option in passing, pointing out that it's O(n); the only constructor in the paper lets you hand it an array of items to initially insert in the LST, so elements will have to be removed to make room for more (though it's easy to see how one could specify extra space).
Were it not for the circular array optimization, it would be talloc_realloc() and done; it works or it doesn't. (That's still O(n), since it may require copying the data.)
With the circular array optimization, if lst->idx refers to something other than the beginning of the array, you have to move the elements preceding it to beginning of the newly-available space so it's still contiguous, and keep pivot stack entries consistent with the positions of the elements.
Definition at line 402 of file lst.c.