[−][src]Function maligned::align_first_boxed_default
#[must_use]pub fn align_first_boxed_default<T: Default, A: Alignment>(
s_capacity: usize
) -> Box<[T]>
Aligns types and initializes memory to default then returns a boxed slice. Since boxed slices can never re-allocate the first item will always be aligned.
let s = align_first_boxed_default::<u8, A128>(2047); assert_eq!(s.len(), 2047); s.iter().for_each(|b| assert_eq!(*b, 0));