usestatic_alloc::Slab;usestd::thread;#[test]fneach_thread_one(){constCOUNT:usize=10;// Static but not the global allocator.
staticSLAB:Slab<[u64;COUNT]>=Slab::uninit();let threads =(0..COUNT).map(|i|thread::spawn(move||{SLAB.leak(i).unwrap();})).collect::<Vec<_>>();
threads
.into_iter().try_for_each(thread::JoinHandle::join).expect("No thread failed to allocate");// But now no more left.
assert!(SLAB.leak(0).is_err());}