Add a static immutable zero aligned type

This commit is contained in:
junderw 2021-12-04 13:04:13 +09:00
parent a1705e3f9d
commit 9cf552e240
No known key found for this signature in database
GPG Key ID: B256185D3A971908
1 changed files with 3 additions and 0 deletions

View File

@ -42,6 +42,9 @@ impl AlignedType {
}
}
/// A static zeroed out AlignedType for use in static assignments of [AlignedType; _]
pub static ZERO_ALIGNED: AlignedType = AlignedType([0u8; 16]);
#[cfg(all(feature = "std", not(rust_secp_no_symbol_renaming)))]
pub(crate) const ALIGN_TO: usize = mem::align_of::<AlignedType>();