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 68
68
//!
69
69
//! [bounded MPMC queue]: http://www.1024cores.net/home/lock-free-algorithms/queues/bounded-mpmc-queue
70
70
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
+
71
88
#[ cfg( feature = "mpmc_crossbeam" ) ]
72
89
pub mod crossbeam_array_queue;
73
90
#[ cfg( feature = "mpmc_crossbeam" ) ]
@@ -77,3 +94,8 @@ pub use crossbeam_array_queue::*;
77
94
mod original;
78
95
#[ cfg( not( feature = "mpmc_crossbeam" ) ) ]
79
96
pub 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