pub const Options = struct stack_trace_frames: usize = if (is_debug and std.debug.sys_can_stack_trace) 7 else 0check_write_after_free: bool = is_debugcanary: u32 = 0x85dff10fA 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_log2Controls 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
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
67pub 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,
}