Skip to main content

alloc_aligned_custom

Function alloc_aligned_custom 

Source
pub fn alloc_aligned_custom<T>(size: usize, align: usize) -> Vec<T>
Expand description

Allocates a zero-initialized Vec<T> with custom alignment.

The total byte size (size * size_of::<T>()) must be a multiple of align, and align must be a power of two.

ยงPanics

  • If T is zero-sized.
  • If align is not a power of two.
  • If size * size_of::<T>() is not a multiple of align.