zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 0362d9f3215e36dd12b5ba47bca8a9cd107b1697 (tree)
parent 60447ea97cd86e38e566c23d40c123e19d50eb1a
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Thu,  1 Jan 2026 18:00:12 -0800

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.

Diffstat:
Mlib/std/start.zig | 9++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git 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();