diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-10-19 14:08:21 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-10-29 06:20:50 -0700 |
| commit | 10b1eef2d3901d17cf8810689a9e1eaf6d7901d9 (patch) | |
| tree | c5312175f5f2716813322196dc10cdabf6b73f51 /lib/std/testing.zig | |
| parent | b215f8667a0cc59888926fcfcbb4be4370bd2216 (diff) | |
| download | zig-10b1eef2d3901d17cf8810689a9e1eaf6d7901d9.tar.gz zig-10b1eef2d3901d17cf8810689a9e1eaf6d7901d9.zip | |
std: fix compilation errors on Windows
Diffstat (limited to 'lib/std/testing.zig')
| -rw-r--r-- | lib/std/testing.zig | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/std/testing.zig b/lib/std/testing.zig index 02ad99932e..7cef6f9c58 100644 --- a/lib/std/testing.zig +++ b/lib/std/testing.zig @@ -1148,6 +1148,7 @@ pub fn checkAllAllocationFailures(backing_allocator: std.mem.Allocator, comptime } else |err| switch (err) { error.OutOfMemory => { if (failing_allocator_inst.allocated_bytes != failing_allocator_inst.freed_bytes) { + const tty_config = std.Io.tty.detectConfig(.stderr()); print( "\nfail_index: {d}/{d}\nallocated bytes: {d}\nfreed bytes: {d}\nallocations: {d}\ndeallocations: {d}\nallocation that was made to fail: {f}", .{ @@ -1157,7 +1158,10 @@ pub fn checkAllAllocationFailures(backing_allocator: std.mem.Allocator, comptime failing_allocator_inst.freed_bytes, failing_allocator_inst.allocations, failing_allocator_inst.deallocations, - failing_allocator_inst.getStackTrace(), + std.debug.FormatStackTrace{ + .stack_trace = failing_allocator_inst.getStackTrace(), + .tty_config = tty_config, + }, }, ); return error.MemoryLeakDetected; |
