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 Struct

Header

Public Struct
std.zig.Zir.Header
pub const Header = extern struct

The data stored at byte offset 0 when ZIR is stored in a file.

Fields

instructions_len: u32
string_bytes_len: u32
extra_len: u32
unused: u32 = 0

We could leave this as padding, however it triggers a Valgrind warning because we read and write undefined bytes to the file system. This is harmless, but it's essentially free to have a zero field here and makes the warning go away, making it more likely that following Valgrind warnings will be taken seriously.

stat_inode: Io.File.INode
stat_size: u64
stat_mtime: i128

File

zig/Zir.zig:39
39
40
41
42
43
44
45
46
47
48
49
50
51
pub const Header = extern struct {
    instructions_len: u32,
    string_bytes_len: u32,
    extra_len: u32,
    /// We could leave this as padding, however it triggers a Valgrind warning because
    /// we read and write undefined bytes to the file system. This is harmless, but
    /// it's essentially free to have a zero field here and makes the warning go away,
    /// making it more likely that following Valgrind warnings will be taken seriously.
    unused: u32 = 0,
    stat_inode: Io.File.INode,
    stat_size: u64,
    stat_mtime: i128,
}