#alignment #alloc #no-std #allocation

no-std aligned-utils

Common utilities to work with aligned values and allocation

4 releases (stable)

1.0.2 Feb 27, 2021
1.0.1 Jan 28, 2021
1.0.0 Jan 12, 2021
0.2.0 Dec 31, 2020

#998 in Data structures

Download history 61/week @ 2024-12-25 74/week @ 2025-01-01 78/week @ 2025-01-08 96/week @ 2025-01-15 86/week @ 2025-01-22 88/week @ 2025-01-29 90/week @ 2025-02-05 89/week @ 2025-02-12 85/week @ 2025-02-19 118/week @ 2025-02-26 90/week @ 2025-03-05 88/week @ 2025-03-12 138/week @ 2025-03-19 127/week @ 2025-03-26 86/week @ 2025-04-02 105/week @ 2025-04-09

468 downloads per month
Used in 2 crates

MIT license

14KB
308 lines

aligned-utils

Crates.io MIT licensed Docs CI

Common utilities to work with aligned values and allocation.

Example

use aligned_utils::stack::Align8;
let mut arr = Align8([1, 2, 3]);
let bytes: &[u8] = &*arr;
use aligned_utils::bytes::AlignedBytes;  // with feature "alloc"
let mut bytes = AlignedBytes::new_zeroed(1024, 8);
let buf: &mut [u8] = &mut *bytes;

No runtime deps

Features