Returns the first address of a write after free
fn checkFreed(s: *SafeAllocator, footer: *AllocFooter) void
fn 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)),
});
};
}