summaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.zig b/src/main.zig
index 2c2cf8c..15dca16 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -25,9 +25,9 @@ pub fn main() !void {
25 _ = args_iter.skip(); 25 _ = args_iter.skip();
26 const in_path = args_iter.next() orelse return error.MissingArg; 26 const in_path = args_iter.next() orelse return error.MissingArg;
27 27
28 var gpa = std.heap.GeneralPurposeAllocator(.{}){}; 28 var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
29 defer _ = gpa.deinit(); 29 defer arena.deinit();
30 const allocator = gpa.allocator(); 30 const allocator = arena.allocator();
31 31
32 const input = try std.fs.cwd().readFileAlloc(allocator, in_path, std.math.maxInt(u32)); 32 const input = try std.fs.cwd().readFileAlloc(allocator, in_path, std.math.maxInt(u32));
33 defer allocator.free(input); 33 defer allocator.free(input);
@@ -51,9 +51,9 @@ pub fn main() !void {
51 // while (iter.next()) |_| result += 1; 51 // while (iter.next()) |_| result += 1;
52 // while (iter.next()) |line| result += strWidth(line, &data); 52 // while (iter.next()) |line| result += strWidth(line, &data);
53 while (iter.next()) |line| { 53 while (iter.next()) |line| {
54 var nfc = try n.nfc(allocator, line); 54 const nfc = try n.nfc(allocator, line);
55 result += nfc.slice.len; 55 result += nfc.slice.len;
56 nfc.deinit(); 56 // nfc.deinit();
57 } 57 }
58 58
59 std.debug.print("result: {}, took: {}\n", .{ result, timer.lap() / std.time.ns_per_ms }); 59 std.debug.print("result: {}, took: {}\n", .{ result, timer.lap() / std.time.ns_per_ms });