9292//!
9393//! - All execution times are in clock cycles. 1 clock cycle = 125 ns.
9494//! - 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.
9696//! - The optimization level is indicated in the first row.
9797//! - 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`).
9999
100100use core:: { borrow:: Borrow , cell:: UnsafeCell , fmt, hash, mem:: MaybeUninit , ptr} ;
101101
@@ -135,7 +135,6 @@ pub type Queue<T, const N: usize> = QueueInner<T, OwnedStorage<N>>;
135135pub type QueueView < T > = QueueInner < T , ViewStorage > ;
136136
137137impl < T , const N : usize > Queue < T , N > {
138- const INIT : UnsafeCell < MaybeUninit < T > > = UnsafeCell :: new ( MaybeUninit :: uninit ( ) ) ;
139138 /// Creates an empty queue with a fixed capacity of `N - 1`
140139 pub const fn new ( ) -> Self {
141140 // Const assert N > 1
@@ -144,7 +143,7 @@ impl<T, const N: usize> Queue<T, N> {
144143 Queue {
145144 head : AtomicUsize :: new ( 0 ) ,
146145 tail : AtomicUsize :: new ( 0 ) ,
147- buffer : [ Self :: INIT ; N ] ,
146+ buffer : [ const { UnsafeCell :: new ( MaybeUninit :: uninit ( ) ) } ; N ] ,
148147 }
149148 }
150149
0 commit comments