Skip to main content

Guard

Trait Guard 

Source
pub trait Guard<V: Value> {
    // Required methods
    unsafe fn retire_node(&mut self, bits: usize, node: NonZeroU64);
    unsafe fn retire_value(&mut self, value: u64);
}
Expand description

Protects allocations from deallocation, and allows allocations to be retired.

External implementations may call deallocate_node and deallocate_value to deallocate nodes and values (passed via Guard::retire_node and Guard::retire_value) when they can determine there are no live references.

Required Methods§

Source

unsafe fn retire_node(&mut self, bits: usize, node: NonZeroU64)

Retire an internal node with prefix length bits.

§Safety

Caller must guarantee node is a valid node pointer.

Source

unsafe fn retire_value(&mut self, value: u64)

Retire a value.

§Safety

Caller must guarantee value is a valid value pointer.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'g, V: Value> Guard<V> for LocalGuard<'g>

Source§

unsafe fn retire_node(&mut self, _bits: usize, node: NonZeroU64)

Source§

unsafe fn retire_value(&mut self, value: u64)

Implementors§

Source§

impl<G, V: Value> Guard<V> for Guard<G, V>