From 0362d9f3215e36dd12b5ba47bca8a9cd107b1697 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 1 Jan 2026 18:00:12 -0800 Subject: [PATCH] start: make leaks into warnings I think it will be less confusing if memory leak checking doesn't change the return code of the process. --- lib/std/start.zig | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/std/start.zig b/lib/std/start.zig index 6db64c26bd..c4d30cfa09 100644 --- a/lib/std/start.zig +++ b/lib/std/start.zig @@ -669,17 +669,16 @@ inline fn callMain(args: std.process.Args.Vector, environ: std.process.Environ.B else std.heap.smp_allocator; - defer if (use_debug_allocator) switch (debug_allocator.deinit()) { - .leak => std.process.exit(1), - .ok => {}, + defer if (use_debug_allocator) { + _ = debug_allocator.deinit(); // Leaks do not affect return code. }; var arena_allocator = std.heap.ArenaAllocator.init(std.heap.page_allocator); defer arena_allocator.deinit(); var threaded: std.Io.Threaded = .init(gpa, .{ - .argv0 = .init(.{ .value = args }), - .environ = .{ .process_environ = .{ .block = environ } }, + .argv0 = .init(.{ .vector = args }), + .environ = .{ .block = environ }, }); defer threaded.deinit();