repl_wasm: update static assertions for struct sizes

This commit is contained in:
Brian Carroll 2022-02-23 17:12:03 +00:00
parent 67658ed7b5
commit 9544b3ba6c
2 changed files with 16 additions and 6 deletions

View file

@ -44,8 +44,8 @@ roc_error_macros::assert_sizeof_aarch64!(CallType, 5 * 8);
roc_error_macros::assert_sizeof_wasm!(Literal, 24); roc_error_macros::assert_sizeof_wasm!(Literal, 24);
roc_error_macros::assert_sizeof_wasm!(Expr, 56); roc_error_macros::assert_sizeof_wasm!(Expr, 56);
roc_error_macros::assert_sizeof_wasm!(Stmt, 96); roc_error_macros::assert_sizeof_wasm!(Stmt, 120);
roc_error_macros::assert_sizeof_wasm!(ProcLayout, 24); roc_error_macros::assert_sizeof_wasm!(ProcLayout, 32);
roc_error_macros::assert_sizeof_wasm!(Call, 40); roc_error_macros::assert_sizeof_wasm!(Call, 40);
roc_error_macros::assert_sizeof_wasm!(CallType, 32); roc_error_macros::assert_sizeof_wasm!(CallType, 32);

View file

@ -19,10 +19,20 @@ use ven_pretty::{DocAllocator, DocBuilder};
// if your changes cause this number to go down, great! // if your changes cause this number to go down, great!
// please change it to the lower number. // please change it to the lower number.
// if it went up, maybe check that the change is really required // if it went up, maybe check that the change is really required
static_assertions::assert_eq_size!([usize; 3], Builtin); roc_error_macros::assert_sizeof_aarch64!(Builtin, 3 * 8);
static_assertions::assert_eq_size!([usize; 4], Layout); roc_error_macros::assert_sizeof_aarch64!(Layout, 4 * 8);
static_assertions::assert_eq_size!([usize; 3], UnionLayout); roc_error_macros::assert_sizeof_aarch64!(UnionLayout, 3 * 8);
static_assertions::assert_eq_size!([usize; 3], LambdaSet); roc_error_macros::assert_sizeof_aarch64!(LambdaSet, 3 * 8);
roc_error_macros::assert_sizeof_wasm!(Builtin, 3 * 4);
roc_error_macros::assert_sizeof_wasm!(Layout, 6 * 4);
roc_error_macros::assert_sizeof_wasm!(UnionLayout, 3 * 4);
roc_error_macros::assert_sizeof_wasm!(LambdaSet, 3 * 4);
roc_error_macros::assert_sizeof_default!(Builtin, 3 * 8);
roc_error_macros::assert_sizeof_default!(Layout, 4 * 8);
roc_error_macros::assert_sizeof_default!(UnionLayout, 3 * 8);
roc_error_macros::assert_sizeof_default!(LambdaSet, 3 * 8);
pub type TagIdIntType = u16; pub type TagIdIntType = u16;
pub const MAX_ENUM_SIZE: usize = (std::mem::size_of::<TagIdIntType>() * 8) as usize; pub const MAX_ENUM_SIZE: usize = (std::mem::size_of::<TagIdIntType>() * 8) as usize;