DoublyList

Type Alias DoublyList 

Source
pub type DoublyList<T, P = SplitVec<Node<Doubly<T>>, Recursive>> = List<Doubly<T>, MemoryReclaimOnThreshold<2, Doubly<T>, Doubly<T>::Reclaimer>, P>;
Expand description

A doubly linked list with default memory reclaim policy:

  • nodes hold a reference to the next element, and a reference to the previous;
  • memory of removed nodes are automatically reclaimed when utilization falls below 75%.

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

Aliased Type§

pub struct DoublyList<T, P = SplitVec<Node<Doubly<T>>, Recursive>>(/* private fields */);

Implementations§

Source§

impl<T> DoublyList<T>

Source

pub fn new() -> Self

Creates an empty doubly linked list with default memory reclaim policy.

Source

pub fn with_threshold_reclaimer<const D: usize>() -> DoublyListThreshold<D, T>

Creates an empty doubly linked list with custom memory reclaim on threshold policy:

  • 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 Lazy).
    • 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%.

Trait Implementations§

Source§

impl<T> Default for DoublyList<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more