I have my code as below, and it is notifying me if there is a leack or no, but I would like to catch the areas of memory leak without geting the program paniced or exited, is there any way to do that?
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
const allocator = gpa.allocator();
defer if (gpa.deinit() != .ok) {
std.log.err("oh no, we've got a leak", .{});
// CAN I ADD SOMETHING HERE TO SHOW ME MORE DEATILS ABOUT THE LEAKS IN MY CODE?
} else {
std.log.debug("memory managed correctly", .{});
};
.
.
.
}