o3 0.14.1

shared-nothing primitives
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::queue;

pub trait Fifo<T> {
    /// # Safety
    /// The queue must have spare capacity.
    unsafe fn push_back_unchecked(&self, value: T);
}

impl<T> Fifo<T> for queue::Fifo<T> {
    unsafe fn push_back_unchecked(&self, value: T) {
        let tail = self.tail.get();
        unsafe {
            (*self.entries.get_unchecked(tail & self.mask()).get()).write(value);
        }
        self.tail.set(tail.wrapping_add(1));
    }
}