pub struct Epoch { /* private fields */ }
Expand description
Epoch
is a unit of time that dictates the lifetime of retired memory regions.
The global epoch rotates four Epoch
values in a range of [0..3]
. An Epoch
value can be
used to check whether a retired memory region is completely unreachable. For example, if the
Epoch
value when a memory region was retired is 0
, it is correct to assume that the memory
region becomes unreachable when the global epoch reaches 3
.
Implementations§
Source§impl Epoch
impl Epoch
Sourcepub const fn next_generation(self) -> Epoch
pub const fn next_generation(self) -> Epoch
Returns a future Epoch
when the current readers will not be present.
The current Epoch
may lag behind the global epoch value by 1
, therefore this method
returns an Epoch
three epochs next to self
.
§Examples
use sdd::Epoch;
let initial = Epoch::default();
let next_generation = initial.next_generation();
assert_eq!(next_generation, initial.next().next().next());
Trait Implementations§
Source§impl Ord for Epoch
impl Ord for Epoch
Source§impl PartialOrd for Epoch
impl PartialOrd for Epoch
impl Copy for Epoch
impl Eq for Epoch
impl StructuralPartialEq for Epoch
Auto Trait Implementations§
impl Freeze for Epoch
impl RefUnwindSafe for Epoch
impl Send for Epoch
impl Sync for Epoch
impl Unpin for Epoch
impl UnwindSafe for Epoch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more