No stack frame capture for non-debug modes

This commit is contained in:
Jonathan Hähne 2021-03-30 12:38:07 +02:00
parent b7cbb10610
commit 11a5d99c93

View File

@ -1672,7 +1672,9 @@ fn processJsonRpc(arena: *std.heap.ArenaAllocator, parser: *std.json.Parser, jso
logger.debug("Method without return value not implemented: {s}", .{method});
}
var gpa_state = std.heap.GeneralPurposeAllocator(.{ .stack_trace_frames = 8 }){};
const stack_frames = switch (std.builtin.mode) { .Debug => 10, else => 0 };
var gpa_state = std.heap.GeneralPurposeAllocator(.{ .stack_trace_frames = stack_frames }){};
pub fn main() anyerror!void {
defer _ = gpa_state.deinit();
allocator = &gpa_state.allocator;