diff options
author | Martin Ashby <martin@ashbysoft.com> | 2023-12-03 22:09:16 +0000 |
---|---|---|
committer | Martin Ashby <martin@ashbysoft.com> | 2023-12-03 22:09:16 +0000 |
commit | 4700fa924ab82ca2e41daa627a59f691d8177d5b (patch) | |
tree | 3f6998b9ee11656b46d298d94be222ed3c08252f /day1.zig | |
parent | ecfca750dff292d5083465a2ca5b6106649b92af (diff) | |
download | aoc2023-4700fa924ab82ca2e41daa627a59f691d8177d5b.tar.gz aoc2023-4700fa924ab82ca2e41daa627a59f691d8177d5b.tar.bz2 aoc2023-4700fa924ab82ca2e41daa627a59f691d8177d5b.tar.xz aoc2023-4700fa924ab82ca2e41daa627a59f691d8177d5b.zip |
Fix the annoying freeze on .free
It was caused by duplicating GeneralPurposeAllocator,
by using it as a struct value. It has a mutex in it, so don't do that.
Diffstat (limited to 'day1.zig')
-rw-r--r-- | day1.zig | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -49,7 +49,9 @@ const w2d = std.comptime_string_map.ComptimeStringMap(u8, .{ }); pub fn main() !void { - var s = try Setup.get(); + var gpa = std.heap.GeneralPurposeAllocator(.{}){}; + defer _ = gpa.deinit(); + var s = try Setup.get(gpa.allocator()); defer s.deinit(); var l = std.mem.splitScalar(u8, s.input, '\n'); var t: u64 = 0; |