mirror of
https://github.com/Noratrieb/dilaria.git
synced 2026-01-14 17:35:03 +01:00
cool size asserts because perf lmao
This commit is contained in:
parent
ee0ccfcb3b
commit
83803959b6
4 changed files with 35 additions and 23 deletions
9
src/util.rs
Normal file
9
src/util.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
/// Statically asserts that the size of the type is x bytes big (on 64-bit)
|
||||
macro_rules! assert_size {
|
||||
($name:ident == $size:expr) => {
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
const _: [(); $size] = [(); ::std::mem::size_of::<$name>()];
|
||||
};
|
||||
}
|
||||
|
||||
pub(crate) use assert_size;
|
||||
Loading…
Add table
Add a link
Reference in a new issue