feature. See also
. The project being documented here (as the example) is the Zig library itself.
Target.stackAlignment
pub fn stackAlignment(target: *const Target) u16
File
Code
pub fn stackAlignment(target: *const Target) u16 {
switch (target.cpu.arch) {
.ez80 => return 1,
.m68k => return 2,
.amdgcn => return 4,
.arm,
.armeb,
.hppa,
.lanai,
.mips,
.mipsel,
.sparc,
.thumb,
.thumbeb,
=> return 8,
.aarch64,
.aarch64_be,
.alpha,
.bpfeb,
.bpfel,
.hppa64,
.loongarch32,
.loongarch64,
.mips64,
.mips64el,
.sparc64,
.ve,
.wasm32,
.wasm64,
.x86_64,
=> return 16,
// can't handle that level of nuance yet.
.powerpc64,
.powerpc64le,
=> if (target.os.tag == .linux) return 16,
.riscv32,
.riscv32be,
.riscv64,
.riscv64be,
=> if (!target.cpu.has(.riscv, .e)) return 16,
.x86 => if (target.os.tag != .windows and target.os.tag != .uefi) return 16,
.kvx => return 32,
else => {},
}
return @divExact(target.ptrBitWidth(), 8);
}