pub(super) fn new(capacity: usize) -> (Self, usize, usize) {
		let needed_pages = (capacity + ELEMENTS_PER_PAGE - 1) / ELEMENTS_PER_PAGE;
		let vec = Self {
			pages: (0..needed_pages)
				.map(|_| UnsafeCell::new(None))
				.collect::<Vec<_>>()
				.into_boxed_slice(),
			len: AtomicUsize::new(0),
		};
		let memory = mem::size_of::<UnsafeCell<Option<Page<T>>>>() * needed_pages;
		(vec, memory, 1)
	}
/// Constructs a new, empty vector with the specified capacity.
///
/// The capacity cannot be changed afterwards. Otherwise it would not be
/// possible to access elements in a wait-free thread-safe manner.
Constructs a new, empty vector with the specified capacity.
The capacity cannot be changed afterwards. Otherwise it would not be
possible to access elements in a wait-free thread-safe manner.
Constructs a new empty vector with the specified capacity . The capacity cannot be changed afterwards . Otherwise it would not be possible to access elements in a wait - free thread - safe manner .
pub(super) fn new(capacity: usize) -> (Self, usize, usize) {
		let needed_pages = (capacity + ELEMENTS_PER_PAGE - 1) / ELEMENTS_PER_PAGE;
		let vec = Self {
			pages: (0..needed_pages)
				.map(|_| UnsafeCell::new(None))
				.collect::<Vec<_>>()
				.into_boxed_slice(),
			len: AtomicUsize::new(0),
		};
		let memory = mem::size_of::<UnsafeCell<Option<Page<T>>>>() * needed_pages;
		(vec, memory, 1)
	}
pub ( super ) fn new ( capacity : usize ) -> ( Self , usize , usize ) { let needed_pages = ( capacity + ELEMENTS_PER_PAGE - 1 ) / ELEMENTS_PER_PAGE ; let vec = Self { pages : ( 0 .. needed_pages ) . map ( | _ | UnsafeCell :: new ( None ) ) . collect :: < Vec < _ > > ( ) . into_boxed_slice ( ) , len : AtomicUsize :: new ( 0 ) , } ; let memory = mem :: size_of :: < UnsafeCell < Option < Page < T > > > > ( ) * needed_pages ; ( vec , memory , 1 ) }
Constructs a new, empty vector with the specified capacity.
Constructs a new empty vector with the specified capacity .
capacity
usize
capacity
usize