Added memory layout field

This commit is contained in:
Jean-Philippe Bossuat
2025-04-25 08:57:08 +02:00
parent f64d786819
commit f0eaddb63e
3 changed files with 17 additions and 1 deletions

View File

@@ -27,6 +27,14 @@ pub use vmp::*;
pub const GALOISGENERATOR: u64 = 5;
pub const DEFAULTALIGN: usize = 64;
#[derive(Copy, Clone)]
#[repr(u8)]
pub enum LAYOUT {
ROW,
COL,
}
pub fn is_aligned_custom<T>(ptr: *const T, align: usize) -> bool {
(ptr as usize) % align == 0
}