Types that are pointed to by a single word.
In concurrent programming, it is necessary to represent an object within a word because atomic operations (e.g., reads, writes, read-modify-writes) support only single words. This trait qualifies such types that are pointed to by a single word.
The trait generalizes
Box<T> for a sized type
T. In a box, an object of type
allocated in heap and it is owned by a single-word pointer. This trait is also implemented for
[MaybeUninit<T>] by storing its size along with its elements and pointing to the pair of array
size and elements.
use std::mem::MaybeUninit; use crossbeam_epoch::Owned; let o = Owned::<[MaybeUninit<i32>]>::init(10); // allocating [i32; 10]
Associated TypesLoading content...
Associated ConstantsLoading content...
Initializes a with the given initializer.
The result should be a multiple of
Dereferences the given pointer.
Mutably dereferences the given pointer.