File tree Expand file tree Collapse file tree 3 files changed +276
-220
lines changed Expand file tree Collapse file tree 3 files changed +276
-220
lines changed Original file line number Diff line number Diff line change 6868//!
6969//! [bounded MPMC queue]: http://www.1024cores.net/home/lock-free-algorithms/queues/bounded-mpmc-queue
7070
71+ use crate :: storage:: ViewStorage ;
72+
73+ #[ cfg( not( feature = "portable-atomic" ) ) ]
74+ use core:: sync:: atomic;
75+ #[ cfg( feature = "portable-atomic" ) ]
76+ use portable_atomic as atomic;
77+
78+ #[ cfg( feature = "mpmc_large" ) ]
79+ type AtomicTargetSize = atomic:: AtomicUsize ;
80+ #[ cfg( not( feature = "mpmc_large" ) ) ]
81+ type AtomicTargetSize = atomic:: AtomicU8 ;
82+
83+ #[ cfg( feature = "mpmc_large" ) ]
84+ type UintSize = usize ;
85+ #[ cfg( not( feature = "mpmc_large" ) ) ]
86+ type UintSize = u8 ;
87+
7188#[ cfg( feature = "mpmc_crossbeam" ) ]
7289pub mod crossbeam_array_queue;
7390#[ cfg( feature = "mpmc_crossbeam" ) ]
@@ -77,3 +94,8 @@ pub use crossbeam_array_queue::*;
7794mod original;
7895#[ cfg( not( feature = "mpmc_crossbeam" ) ) ]
7996pub use original:: * ;
97+
98+ /// A [`Queue`] with dynamic capacity.
99+ ///
100+ /// [`Queue`] coerces to `QueueView`. `QueueView` is `!Sized`, meaning it can only ever be used by reference.
101+ pub type QueueView < T > = QueueInner < T , ViewStorage > ;
You can’t perform that action at this time.
0 commit comments