pub struct TreiberStack { /* private fields */ }Expand description
Lock-free, ABA-safe, index-based free-list of size slots (indices
0..size), all initially free.
Implementations§
Source§impl TreiberStack
impl TreiberStack
Sourcepub fn push(&self, idx: u32)
pub fn push(&self, idx: u32)
Return idx to the free-list. idx must have previously come from
Self::pop (or from initial construction) and not currently be
held by anything else — pushing an index that’s already free is a
caller bug (double-free of the index) and will corrupt the
free-list for subsequent pops.
Auto Trait Implementations§
impl !Freeze for TreiberStack
impl RefUnwindSafe for TreiberStack
impl Send for TreiberStack
impl Sync for TreiberStack
impl Unpin for TreiberStack
impl UnsafeUnpin for TreiberStack
impl UnwindSafe for TreiberStack
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