Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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 standard library. Public Constant

Block

Public Constant
std.process.Environ.Block
pub const Block = switch (native_os)

On WASI without libc, this is void because the environment has to be queried and heap-allocated at runtime.

On Windows, the memory pointed at by the PEB changes when the environment is modified, so a long-lived pointer cannot be used. Therefore, on this operating system void is also used.

File

process/Environ.zig:25
25
26
27
28
29
30
31
32
33
pub const Block = switch (native_os) {
    .windows => GlobalBlock,
    .wasi, .emscripten => switch (builtin.link_libc) {
        false => GlobalBlock,
        true => PosixBlock,
    },
    .freestanding, .other => GlobalBlock,
    else => PosixBlock,
}