mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
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.
This commit is contained in:
+4
-5
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user