| author | |
| committer | |
| log | f74e10cd4722512ac671f574b3d274ab48abb1a7 |
| tree | a2cf1f798c7f4dc7375efd70d94fc0d82f254838 |
| parent | 8e96be0088d4ae007589651066d426f815aaab4f |
Created from a conversation with @andrewrk on irc: Memory leaks when using ArrayList can be inconvenient to debug when the stack frame size is 4 because the entirety of the printed frame is within zig stdlib, and not in the users calling stack. Increasing this to 6 for Debug builds, gives 2 frames of user code. I increased the frame size for tests as well by the equivalent factor, but I'm unconvinced that's actually desirable.1 files changed, 1 insertions(+), 1 deletions(-)
lib/std/heap/general_purpose_allocator.zig+1-1| ... | ... | @@ -105,7 +105,7 @@ const StackTrace = std.builtin.StackTrace; |
| 105 | 105 | /// Integer type for pointing to slots in a small allocation |
| 106 | 106 | const SlotIndex = std.meta.Int(.unsigned, math.log2(page_size) + 1); |
| 107 | 107 | |
| 108 | const default_test_stack_trace_frames: usize = if (builtin.is_test) 8 else 4; | |
| 108 | const default_test_stack_trace_frames: usize = if (builtin.is_test) 10 else 6; | |
| 109 | 109 | const default_sys_stack_trace_frames: usize = if (std.debug.sys_can_stack_trace) default_test_stack_trace_frames else 0; |
| 110 | 110 | const default_stack_trace_frames: usize = switch (builtin.mode) { |
| 111 | 111 | .Debug => default_sys_stack_trace_frames, |