| ... | @@ -18,6 +18,11 @@ var base_allocator_instance = std.heap.FixedBufferAllocator.init(""); | ... | @@ -18,6 +18,11 @@ var base_allocator_instance = std.heap.FixedBufferAllocator.init(""); |
| 18 | pub const allocator = allocator_instance.allocator(); | 18 | pub const allocator = allocator_instance.allocator(); |
| 19 | pub var allocator_instance: std.heap.GeneralPurposeAllocator(.{ | 19 | pub var allocator_instance: std.heap.GeneralPurposeAllocator(.{ |
| 20 | .stack_trace_frames = 10, | 20 | .stack_trace_frames = 10, |
| | 21 | .resize_stack_traces = true, |
| | 22 | // A unique value so that when a default-constructed |
| | 23 | // GeneralPurposeAllocator is incorrectly passed to testing allocator, or |
| | 24 | // vice versa, panic occurs. |
| | 25 | .canary = @truncate(0x2731e675c3a701ba), |
| 21 | }) = b: { | 26 | }) = b: { |
| 22 | if (!builtin.is_test) @compileError("testing allocator used when not testing"); | 27 | if (!builtin.is_test) @compileError("testing allocator used when not testing"); |
| 23 | break :b .init; | 28 | break :b .init; |