pub const Config = struct stack_trace_frames: usize = default_stack_trace_framesNumber of stack frames to capture.
enable_memory_limit: bool = falseIf true, the allocator will have two fields:
total_requested_bytes which tracks the total allocated bytes of memory requested.requested_memory_limit which causes allocations to return error.OutOfMemory when the total_requested_bytes exceeds this limit. If false, these fields will be void.safety: bool = std.debug.runtime_safetyWhether to enable safety checks.
thread_safe: bool = !builtin.single_threadedWhether the allocator may be used simultaneously from multiple threads.
never_unmap: bool = falseThis is a temporary debugging trick you can use to turn segfaults into more helpful logged error messages with stack trace details. The downside is that every allocation will be leaked, unless used with retain_metadata!
retain_metadata: bool = falseThis is a temporary debugging aid that retains metadata about allocations indefinitely. This allows a greater range of double frees to be reported. All metadata is freed when deinit is called. When used with never_unmap, deliberately leaked memory is also freed during deinit. Currently should be used with never_unmap to avoid segfaults. TODO https://github.com/ziglang/zig/issues/4298 will allow use without never_unmap
verbose_log: bool = falseEnables emitting info messages with the size and address of every allocation.
backing_allocator_zeroes: bool = trueTell whether the backing allocator returns already-zeroed memory.
resize_stack_traces: bool = falseWhen resizing an allocation, refresh the stack trace with the resize callsite. Comes with a performance penalty.
canary: usize = @truncate(0x9232a6ff85dff10f)Magic value that distinguishes allocations owned by this allocator from other regions of memory.
page_size: usize = default_page_sizeThe size of allocations requested from the backing allocator for subdividing into slots for small allocations.
Must be a power of two.
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160pub const Config = struct {
/// Number of stack frames to capture.
stack_trace_frames: usize = default_stack_trace_frames,
/// If true, the allocator will have two fields:
/// * `total_requested_bytes` which tracks the total allocated bytes of memory requested.
/// * `requested_memory_limit` which causes allocations to return `error.OutOfMemory`
/// when the `total_requested_bytes` exceeds this limit.
/// If false, these fields will be `void`.
enable_memory_limit: bool = false,
/// Whether to enable safety checks.
safety: bool = std.debug.runtime_safety,
/// Whether the allocator may be used simultaneously from multiple threads.
thread_safe: bool = !builtin.single_threaded,
/// This is a temporary debugging trick you can use to turn segfaults into more helpful
/// logged error messages with stack trace details. The downside is that every allocation
/// will be leaked, unless used with retain_metadata!
never_unmap: bool = false,
/// This is a temporary debugging aid that retains metadata about allocations indefinitely.
/// This allows a greater range of double frees to be reported. All metadata is freed when
/// deinit is called. When used with never_unmap, deliberately leaked memory is also freed
/// during deinit. Currently should be used with never_unmap to avoid segfaults.
/// TODO https://github.com/ziglang/zig/issues/4298 will allow use without never_unmap
retain_metadata: bool = false,
/// Enables emitting info messages with the size and address of every allocation.
verbose_log: bool = false,
/// Tell whether the backing allocator returns already-zeroed memory.
backing_allocator_zeroes: bool = true,
/// When resizing an allocation, refresh the stack trace with the resize
/// callsite. Comes with a performance penalty.
resize_stack_traces: bool = false,
/// Magic value that distinguishes allocations owned by this allocator from
/// other regions of memory.
canary: usize = @truncate(0x9232a6ff85dff10f),
/// The size of allocations requested from the backing allocator for
/// subdividing into slots for small allocations.
///
/// Must be a power of two.
page_size: usize = default_page_size,
}