From 722427b693b22b101f4a81281636051bd3b3920f Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Sun, 21 May 2023 11:46:05 -0500 Subject: [PATCH] chore: update to latest zig master --- src/bench.zig | 2 +- src/trie.zig | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bench.zig b/src/bench.zig index e4cc573..3149bf9 100644 --- a/src/bench.zig +++ b/src/bench.zig @@ -18,7 +18,7 @@ const StringHashMap = std.hash_map.StringHashMap(void); pub fn main() !void { var gpa = std.heap.GeneralPurposeAllocator(.{}){}; - defer std.debug.assert(!gpa.deinit()); + defer std.debug.assert(gpa.deinit() == .ok); const allocator = gpa.allocator(); const elem_count = 1000; diff --git a/src/trie.zig b/src/trie.zig index 983ea00..2417811 100644 --- a/src/trie.zig +++ b/src/trie.zig @@ -45,7 +45,7 @@ pub fn HashArrayMappedTrie(comptime K: type, comptime V: type, comptime Context: pub fn init(allocator: Allocator) !FreeList { const list = try allocator.create([table_size]?FreeList.Node); - std.mem.set(?FreeList.Node, list, null); + @memset(list, null); return .{ .list = list }; } @@ -147,7 +147,7 @@ pub fn HashArrayMappedTrie(comptime K: type, comptime V: type, comptime Context: pub fn init(allocator: Allocator) !Self { // TODO: Add ability to have a larger root node (for quicker lookup times) const root = try allocator.alloc(?*Node, table_size); - std.mem.set(?*Node, root, null); + @memset(root, null); return Self{ .root = root, .free_list = try FreeList.init(allocator) }; }