Struct MemoryReclaimOnThreshold

Source
pub struct MemoryReclaimOnThreshold<const D: usize, V: Variant, R: MemoryReclaimer<V>> { /* private fields */ }
Expand description

Memory reclaim policy which triggers the reclaim operation whenever the node utilization falls below a certain threshold.

Specifically, memory of closed nodes will be reclaimed whenever 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%.

Implementations§

Source§

impl<const D: usize, V: Variant, R: MemoryReclaimer<V>> MemoryReclaimOnThreshold<D, V, R>

Source

pub fn col_needs_memory_reclaim<P>(col: &SelfRefCol<V, Self, P>) -> bool
where P: PinnedVec<Node<V>>,

Returns whether or not the collection col requires to reclaim memory; i.e., whether or not the utilization is below the constant threshold.

Trait Implementations§

Source§

impl<const D: usize, V: Variant, R: MemoryReclaimer<V>> Clone for MemoryReclaimOnThreshold<D, V, R>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const D: usize, V: Variant, R: MemoryReclaimer<V>> Default for MemoryReclaimOnThreshold<D, V, R>

Source§

fn default() -> Self

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

impl<const D: usize, V, R> MemoryPolicy<V> for MemoryReclaimOnThreshold<D, V, R>
where V: Variant, R: MemoryReclaimer<V>,

Source§

fn reclaim_closed_nodes<P>( col: &mut CoreCol<V, P>, _closed_node_ptr: &NodePtr<V>, ) -> bool
where P: PinnedVec<Node<V>>,

Reclaims closed nodes. Read more

Auto Trait Implementations§

§

impl<const D: usize, V, R> Freeze for MemoryReclaimOnThreshold<D, V, R>

§

impl<const D: usize, V, R> RefUnwindSafe for MemoryReclaimOnThreshold<D, V, R>

§

impl<const D: usize, V, R> Send for MemoryReclaimOnThreshold<D, V, R>
where V: Send, R: Send,

§

impl<const D: usize, V, R> Sync for MemoryReclaimOnThreshold<D, V, R>
where V: Sync, R: Sync,

§

impl<const D: usize, V, R> Unpin for MemoryReclaimOnThreshold<D, V, R>
where V: Unpin, R: Unpin,

§

impl<const D: usize, V, R> UnwindSafe for MemoryReclaimOnThreshold<D, V, R>
where V: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> SoM<T> for T

Source§

fn get_ref(&self) -> &T

Returns a reference to self.
Source§

fn get_mut(&mut self) -> &mut T

Returns a mutable reference to self.
Source§

impl<T> SoR<T> for T

Source§

fn get_ref(&self) -> &T

Returns a reference to self.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.