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

State

Public Struct
std.heap.ArenaAllocator.State
pub const State = struct

Inner state of ArenaAllocator. Can be stored rather than the entire ArenaAllocator as a memory-saving optimization.

Default initialization of this struct is deprecated; use init instead.

Fields

used_list: ?*Node = null
free_list: ?*Node = null

Values

Functions

pub fn promote(state: State, child_allocator: Allocator) ArenaAllocator

File

heap/ArenaAllocator.zig:17
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
pub const State = struct {
    used_list: ?*Node = null,
    free_list: ?*Node = null,

    pub const init: State = .{
        .used_list = null,
        .free_list = null,
    };

    pub fn promote(state: State, child_allocator: Allocator) ArenaAllocator {
        return .{
            .child_allocator = child_allocator,
            .state = state,
        };
    }
}