| ... | ... | @@ -9,18 +9,20 @@ pub var random_seed: u32 = 0; |
| 9 | 9 | |
| 10 | 10 | pub const FailingAllocator = @import("testing/FailingAllocator.zig"); |
| 11 | 11 | pub const failing_allocator = failing_allocator_instance.allocator(); |
| 12 | | pub var failing_allocator_instance = FailingAllocator.init(base_allocator_instance.allocator(), .{ .fail_index = 0 }); |
| 12 | var failing_allocator_instance = FailingAllocator.init(base_allocator_instance.allocator(), .{ |
| 13 | .fail_index = 0, |
| 14 | }); |
| 15 | var base_allocator_instance = std.heap.FixedBufferAllocator.init(""); |
| 13 | 16 | |
| 14 | 17 | /// This should only be used in temporary test programs. |
| 15 | 18 | pub const allocator = allocator_instance.allocator(); |
| 16 | | pub var allocator_instance: std.heap.GeneralPurposeAllocator(.{}) = b: { |
| 17 | | if (!builtin.is_test) |
| 18 | | @compileError("Cannot use testing allocator outside of test block"); |
| 19 | pub var allocator_instance: std.heap.GeneralPurposeAllocator(.{ |
| 20 | .stack_trace_frames = 10, |
| 21 | }) = b: { |
| 22 | if (!builtin.is_test) @compileError("testing allocator used when not testing"); |
| 19 | 23 | break :b .init; |
| 20 | 24 | }; |
| 21 | 25 | |
| 22 | | pub var base_allocator_instance = std.heap.FixedBufferAllocator.init(""); |
| 23 | | |
| 24 | 26 | /// TODO https://github.com/ziglang/zig/issues/5738 |
| 25 | 27 | pub var log_level = std.log.Level.warn; |
| 26 | 28 | |