//! A lock-free concurrent stack using compare-and-swap.
//!
//! Wait-free push, lock-free pop. No mutexes, no blocking.
//! Each thread can make progress independently — useful for
//! work-stealing schedulers, undo buffers, and memory pools.
//!
//! The ABA problem is solved with pointer tagging: each CAS
//! uses a generation counter packed alongside the pointer.
use std::sync::atomic::{AtomicPtr, AtomicUsize, Ordering};
use std::ptr;
lockfree_stack.rs