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

Options

Public Struct
std.heap.SafeAllocator.Options
pub const Options = struct

Fields

stack_trace_frames: usize = if (is_debug and std.debug.sys_can_stack_trace) 7 else 0
check_write_after_free: bool = is_debug
canary: u32 = 0x85dff10f

A unique value used to check that allocations created by other SafeAllocator instances are not passed to this one.

bucket_size_log2: u5 = @max(page_size_log2, 13)

Controls the block size and alignment of allocation buckets.

Changing this is useful to save memory if the backing allocator offers better granuality, or if the backing allocator has a limit on active allocations, however decreasing this can harm performance.

Asserted to be >= 8

block_size_log2: u5 = page_size_log2

Controls the block size of internal metadata.

Changing this is useful to save memory if the backing allocator offers better granuality, or if the backing allocator has a limit on active allocations, however decreasing this can harm performance.

Asserted to be >= 8

Values

File

heap/SafeAllocator.zig:41
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
pub const Options = struct {
    const is_debug = @import("builtin").mode == .debug;
    const page_size_log2 = @max(math.log2_int(usize, std.heap.page_size_max), 8);

    stack_trace_frames: usize = if (is_debug and std.debug.sys_can_stack_trace) 7 else 0,
    check_write_after_free: bool = is_debug,
    /// A unique value used to check that allocations created by other
    /// `SafeAllocator` instances are not passed to this one.
    canary: u32 = 0x85dff10f,

    /// Controls the block size and alignment of allocation buckets.
    ///
    /// Changing this is useful to save memory if the backing allocator offers better granuality,
    /// or if the backing allocator has a limit on active allocations, however decreasing this
    /// can harm performance.
    ///
    /// Asserted to be >= 8
    bucket_size_log2: u5 = @max(page_size_log2, 13),
    /// Controls the block size of internal metadata.
    ///
    /// Changing this is useful to save memory if the backing allocator offers better granuality,
    /// or if the backing allocator has a limit on active allocations, however decreasing this
    /// can harm performance.
    ///
    /// Asserted to be >= 8
    block_size_log2: u5 = page_size_log2,
}