fn checkFreed(s: *SafeAllocator, footer: *AllocFooter) void s: *SafeAllocatorfooter: *AllocFooter835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852fn checkFreed(s: *SafeAllocator, footer: *AllocFooter) void {
if (!s.check_write_after_free) return;
const memory = footer.userMemory();
for (memory) |*b| if (b.* != 0x55) {
panic(
\\write after free at *{x}
\\original alloc of {f}: {f}
\\free: {f}
\\stack trace:
// (panic stack trace)
, .{
@intFromPtr(b),
FormatMemory{ .memory = memory, .alignment = footer.userAlign() },
formatStackTrace(footer.allocTrace(s)),
formatStackTrace(footer.freeTrace(s)),
});
};
}
Returns the first address of a write after free