aligned_box: Allocate aligned heap memory in Rust.
This crate provides a wrapper around the Box type, which allows allocating heap memory with user-specified alignment.
Examples
Place value 17 of type i32 on the heap, aligned to 64 bytes:
use AlignedBox;
let b = new;
Allocate memory for 1024 values of type f32 on the heap, aligned to 128 bytes. Values are initialized by their default value:
use AlignedBox;
let b = slice_from_default;
Allocate memory for 1024 values of type f32 on the heap, aligned to 128 bytes. All values are initialized with PI:
use AlignedBox;
let b = slice_from_value;