From 045624beac13f7a2c8422700dd13dae3d82c35f4 Mon Sep 17 00:00:00 2001 From: "andrew.kraevskii" Date: Wed, 4 Mar 2026 01:43:59 +0300 Subject: [PATCH] Use leak detection of DebugAllocator. When allocating memory it remebers where memory was allocated but it only for leaks in .deinit(). So not calling it is a sure way to miss a bunch of leaks. deinit() returns if it found leaks but we don't really care. Its usefull for tests but not here. --- src/main.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.zig b/src/main.zig index 0a46dd0..f641daa 100644 --- a/src/main.zig +++ b/src/main.zig @@ -5,7 +5,9 @@ const WindowContext = @import("WindowContext.zig"); const ui = @import("ui/frame.zig"); pub fn main() !void { - var gpa = std.heap.GeneralPurposeAllocator(.{}){}; + // std.heap.GeneralPurposeAllocator was renamed to DebugAllocator recently. + var gpa: std.heap.DebugAllocator(.{}) = .init; + defer _ = gpa.deinit(); const allocator = gpa.allocator(); var backend = try SDLBackend.initWindow(.{