const PackedOptionalU15 = packed struct(u16) value: u15is_null: boolpub fn int(p: PackedOptionalU15) u1636
37
38
39
40
41
42
43
44
45const PackedOptionalU15 = packed struct(u16) {
value: u15,
is_null: bool,
pub fn int(p: PackedOptionalU15) u16 {
return @bitCast(p);
}
pub const null_bit: PackedOptionalU15 = .{ .value = 0, .is_null = true };
}
Until #104 is implemented, a ?u15 takes 4 bytes, which is unacceptable as it doubles the size of this already massive structure.
Also, there are no
to/frommethods because LLVM 21 does not optimize away the conversion from and to?u15.