mirror of
https://github.com/fairyglade/ly.git
synced 2026-08-06 21:21:58 +00:00
GPA: Add more tracking in Debug
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
@@ -149,8 +149,11 @@ pub fn main(init: std.process.Init) !void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var gpa = std.heap.DebugAllocator(.{}).init;
|
var gpa: std.heap.DebugAllocator(.{
|
||||||
defer _ = gpa.deinit();
|
.never_unmap = builtin.mode == .Debug,
|
||||||
|
.retain_metadata = builtin.mode == .Debug,
|
||||||
|
}) = .init;
|
||||||
|
defer if (gpa.deinit() == .leak) std.log.err("attention please, memory has been leaked!", .{});
|
||||||
|
|
||||||
state.allocator = gpa.allocator();
|
state.allocator = gpa.allocator();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user