From 60ce5edaf9f9bd9c500eb74d6e775baa7867ed84 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 11 Aug 2020 14:05:28 -0700 Subject: [PATCH] GeneralPurposeAllocator: default to store more stack frames in test mode Now tests will by default store 8 stack frames per allocation rather than the normal default of 4. --- lib/std/heap/general_purpose_allocator.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/std/heap/general_purpose_allocator.zig b/lib/std/heap/general_purpose_allocator.zig index 957c38939ce267f7cf0b6a76274f0aa2d2605e20..7b885bca36bdc1c0c31e6cea16b55f3b2abd8e1d 100644 --- a/lib/std/heap/general_purpose_allocator.zig +++ b/lib/std/heap/general_purpose_allocator.zig @@ -118,7 +118,8 @@ const sys_can_stack_trace = switch (std.Target.current.cpu.arch) { else => true, }; -const default_sys_stack_trace_frames: usize = if (sys_can_stack_trace) 4 else 0; +const default_test_stack_trace_frames: usize = if (std.builtin.is_test) 8 else 4; +const default_sys_stack_trace_frames: usize = if (sys_can_stack_trace) default_test_stack_trace_frames else 0; const default_stack_trace_frames: usize = switch (std.builtin.mode) { .Debug => default_sys_stack_trace_frames, else => 0, -- 2.54.0