From 0102963433d37fda2ab07550f1831eab153c861f Mon Sep 17 00:00:00 2001 From: Alexandros Naskos Date: Sun, 28 Jun 2020 16:16:41 +0300 Subject: [PATCH] Fixed formatting on master --- src/main.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.zig b/src/main.zig index bce110a..66cc4e1 100644 --- a/src/main.zig +++ b/src/main.zig @@ -1349,8 +1349,11 @@ fn processJsonRpc(parser: *std.json.Parser, json: []const u8, config: Config, ke process.stdin.?.close(); process.stdin = null; - const stdout_bytes = try process.stdout.?.reader().readAllAlloc(allocator, std.math.maxInt(usize)); - defer allocator.free(stdout_bytes); + // TODO readAllAlloc degfaults with the page allocator + var arena = std.heap.ArenaAllocator.init(allocator); + defer arena.deinit(); + const stdout_bytes = try process.stdout.?.reader().readAllAlloc(&arena.allocator, std.math.maxInt(usize)); + // defer allocator.free(stdout_bytes); switch (try process.wait()) { .Exited => |code| if (code == 0) {