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.
This commit is contained in:
Andrew Kelley 2020-08-11 14:05:28 -07:00
parent 3ccfd58bb6
commit 60ce5edaf9

View File

@ -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,