use UnsafeCell;
use MaybeUninit;
use AtomicU64;
/// One ring slot: publish flag and payload share a cache line, so a push
/// moves both to the consumer in a single line transfer.
///
/// `seq` is a producer-written publish flag. The producer stores
/// `seq = pos + 1` after writing the payload for position `pos`; the consumer
/// reads the slot when `seq == pos + 1`. The consumer never writes the slot
/// (it signals reuse via the ring's `progress` counter), so the hot line only
/// moves producer to consumer, never back. Flags from earlier laps differ by
/// a multiple of `N`, and the check is an equality, so `u64` wraparound is
/// harmless while `N` is a power of two (it divides 2^64 evenly).
///
/// A payload larger than 56 bytes spills onto further cache lines; the flag
/// still shares the first line with the payload head.
pub