store-io-buf 0.3.0

Aligned, pooled, zero-allocation I/O buffers for store-io, with a lock-free free list and secure wipe.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Atomics that loom can model (`--cfg loom`) or the real ones.

#[cfg(loom)]
pub(crate) use loom::sync::atomic::{AtomicU32, AtomicUsize, Ordering};

#[cfg(not(loom))]
pub(crate) use core::sync::atomic::{AtomicU32, AtomicUsize, Ordering};

/// Hint inside a retry loop. Under loom it yields so the model checker can
/// schedule the thread the loop is waiting for.
#[inline(always)]
pub(crate) fn spin() {
    #[cfg(loom)]
    loom::thread::yield_now();
    #[cfg(not(loom))]
    core::hint::spin_loop();
}