| ... | @@ -42,6 +42,7 @@ pub fn Main(comptime T: type) type { | ... | @@ -42,6 +42,7 @@ pub fn Main(comptime T: type) type { |
| 42 | std.debug.print("\n", .{}); | 42 | std.debug.print("\n", .{}); |
| 43 | | 43 | |
| 44 | const arena = &std.heap.ArenaAllocator.init(alloc); | 44 | const arena = &std.heap.ArenaAllocator.init(alloc); |
| | 45 | defer arena.deinit(); |
| 45 | while (true) { | 46 | while (true) { |
| 46 | const line = r.readUntilDelimiterAlloc(alloc, '\n', max_size) catch |e| if (e == error.EndOfStream) break else return e; | 47 | const line = r.readUntilDelimiterAlloc(alloc, '\n', max_size) catch |e| if (e == error.EndOfStream) break else return e; |
| 47 | defer alloc.free(line); | 48 | defer alloc.free(line); |
| ... | @@ -54,7 +55,6 @@ pub fn Main(comptime T: type) type { | ... | @@ -54,7 +55,6 @@ pub fn Main(comptime T: type) type { |
| 54 | } | 55 | } |
| 55 | | 56 | |
| 56 | if (!(try T.exec(&arena.allocator, line, w))) { | 57 | if (!(try T.exec(&arena.allocator, line, w))) { |
| 57 | arena.deinit(); | | |
| 58 | break; | 58 | break; |
| 59 | } | 59 | } |
| 60 | | 60 | |