Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

stackGrowth

Target.stackGrowth
pub fn stackGrowth(target: *const Target) StackGrowth

File

lib/std/Target.zig:3053

Code

pub fn stackGrowth(target: *const Target) StackGrowth {
    // Strictly speaking, most architectures don't inherently define the stack growth direction; you
    // could quite easily argue that it is in fact a property of the ABI. However, that's just not
    // really how it plays out in the real world. And besides, we have no mechanism for indicating
    // a different stack growth ABI, nor a compelling use case for creating such a mechanism.
    return switch (target.cpu.arch) {
        .hppa,
        .hppa64,
        => .up,
        else => .down,
    };
}