Change round_up_to_alignment to a macro to work on more Rust types

This commit is contained in:
Brian Carroll 2021-12-08 21:11:10 +00:00
parent 6a801ebc7e
commit 1ba654c5b2
4 changed files with 20 additions and 18 deletions

View file

@ -694,8 +694,7 @@ impl<'a> WasmBackend<'a> {
let tag_field_layouts = &tags[tag_id as usize];
let alignment_bytes = Layout::Struct(tag_field_layouts).alignment_bytes(PTR_SIZE);
let tag_id_offset =
round_up_to_alignment(field_offset as i32, alignment_bytes as i32) as u32;
let tag_id_offset = round_up_to_alignment!(field_offset, alignment_bytes);
let tag_id_align = Align::from(alignment_bytes);
match tag_id_align {