/// A simple record with mixed field sizes for alignment testing. record Mixed { a: u8, b: u32, } /// Returns the size of a u8. fn sizeofU8() -> u32 { return @sizeOf(u8); } /// Returns the size of a u32. fn sizeofU32() -> u32 { return @sizeOf(u32); } /// Returns the size of a record type. fn sizeofRecord() -> u32 { return @sizeOf(Mixed); } /// Returns the size of an array type. fn sizeofArray() -> u32 { return @sizeOf([u16; 4]); } /// Returns the size of a pointer type. fn sizeofPtr() -> u32 { return @sizeOf(*u32); } /// Returns the size of a slice type. fn sizeofSlice() -> u32 { return @sizeOf(*[u8]); }