From f6418d582fc2294983bfa647c7148a263af13db5 Mon Sep 17 00:00:00 2001 From: Jose Colon Rodriguez Date: Tue, 27 Feb 2024 11:16:41 -0400 Subject: Using NormPropsData in NormData; No Ziglyph deps in NOrmalizer --- src/main.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/main.zig') 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 { _ = args_iter.skip(); const in_path = args_iter.next() orelse return error.MissingArg; - var gpa = std.heap.GeneralPurposeAllocator(.{}){}; - defer _ = gpa.deinit(); - const allocator = gpa.allocator(); + var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); + defer arena.deinit(); + const allocator = arena.allocator(); const input = try std.fs.cwd().readFileAlloc(allocator, in_path, std.math.maxInt(u32)); defer allocator.free(input); @@ -51,9 +51,9 @@ pub fn main() !void { // while (iter.next()) |_| result += 1; // while (iter.next()) |line| result += strWidth(line, &data); while (iter.next()) |line| { - var nfc = try n.nfc(allocator, line); + const nfc = try n.nfc(allocator, line); result += nfc.slice.len; - nfc.deinit(); + // nfc.deinit(); } std.debug.print("result: {}, took: {}\n", .{ result, timer.lap() / std.time.ns_per_ms }); -- cgit v1.2.3