SinglyListThreshold

Type Alias SinglyListThreshold 

Source
pub type SinglyListThreshold<const D: usize, T, P = SplitVec<Node<Singly<T>>, Recursive>> = List<Singly<T>, MemoryReclaimOnThreshold<D, Singly<T>, <Singly<T> as ListVariant>::Reclaimer>, P>;
Expand description

A singly linked list with custom memory reclaim on threshold policy:

  • nodes hold a reference to the next element, but not to the previous;
  • memory of removed nodes are automatically reclaimed when the ratio of closed nodes to all nodes exceeds one over 2^D:
    • when D = 0: memory will be reclaimed when utilization is below 0.00% (equivalent to never).
    • when D = 1: memory will be reclaimed when utilization is below 50.00%.
    • when D = 2: memory will be reclaimed when utilization is below 75.00%.
    • when D = 3: memory will be reclaimed when utilization is below 87.50%.
    • when D = 4: memory will be reclaimed when utilization is below 93.75%.

Importantly note that methods of the the following traits are also available:

Aliased Type§

pub struct SinglyListThreshold<const D: usize, T, P = SplitVec<Node<Singly<T>>, Recursive>>(/* private fields */);