authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2022-06-23 17:02:29-07:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2022-06-23 17:02:29-07:00
logdef304a9a5b9d001e37c19509a9d2b2450088033
tree8bbad07aa3d5b0d614caf2e4609a686a8c44de80
parent819e0e83d338a898f06d1e39c21da812ac58238b

Integrate FailingAllocator stack trace with testing.checkAllAllocationFailures


1 files changed, 2 insertions(+), 1 deletions(-)

lib/std/testing.zig+2-1
......@@ -650,7 +650,7 @@ pub fn checkAllAllocationFailures(backing_allocator: std.mem.Allocator, comptime
650650 error.OutOfMemory => {
651651 if (failing_allocator_inst.allocated_bytes != failing_allocator_inst.freed_bytes) {
652652 print(
653 "\nfail_index: {d}/{d}\nallocated bytes: {d}\nfreed bytes: {d}\nallocations: {d}\ndeallocations: {d}\n",
653 "\nfail_index: {d}/{d}\nallocated bytes: {d}\nfreed bytes: {d}\nallocations: {d}\ndeallocations: {d}\nallocation that was made to fail: {s}",
654654 .{
655655 fail_index,
656656 needed_alloc_count,
......@@ -658,6 +658,7 @@ pub fn checkAllAllocationFailures(backing_allocator: std.mem.Allocator, comptime
658658 failing_allocator_inst.freed_bytes,
659659 failing_allocator_inst.allocations,
660660 failing_allocator_inst.deallocations,
661 failing_allocator_inst.getStackTrace(),
661662 },
662663 );
663664 return error.MemoryLeakDetected;