92
92
//!
93
93
//! - All execution times are in clock cycles. 1 clock cycle = 125 ns.
94
94
//! - Execution time is *dependent* of `mem::size_of::<T>()`. Both operations include one
95
- //! `memcpy(T)` in their successful path.
95
+ //! `memcpy(T)` in their successful path.
96
96
//! - The optimization level is indicated in the first row.
97
97
//! - The numbers reported correspond to the successful path (i.e. `Some` is returned by `dequeue`
98
- //! and `Ok` is returned by `enqueue`).
98
+ //! and `Ok` is returned by `enqueue`).
99
99
100
100
use core:: { borrow:: Borrow , cell:: UnsafeCell , fmt, hash, mem:: MaybeUninit , ptr} ;
101
101
@@ -135,7 +135,6 @@ pub type Queue<T, const N: usize> = QueueInner<T, OwnedStorage<N>>;
135
135
pub type QueueView < T > = QueueInner < T , ViewStorage > ;
136
136
137
137
impl < T , const N : usize > Queue < T , N > {
138
- const INIT : UnsafeCell < MaybeUninit < T > > = UnsafeCell :: new ( MaybeUninit :: uninit ( ) ) ;
139
138
/// Creates an empty queue with a fixed capacity of `N - 1`
140
139
pub const fn new ( ) -> Self {
141
140
// Const assert N > 1
@@ -144,7 +143,7 @@ impl<T, const N: usize> Queue<T, N> {
144
143
Queue {
145
144
head : AtomicUsize :: new ( 0 ) ,
146
145
tail : AtomicUsize :: new ( 0 ) ,
147
- buffer : [ Self :: INIT ; N ] ,
146
+ buffer : [ const { UnsafeCell :: new ( MaybeUninit :: uninit ( ) ) } ; N ] ,
148
147
}
149
148
}
150
149
0 commit comments