Skip to content

Commit

Permalink
chore: update to latest zig master
Browse files Browse the repository at this point in the history
  • Loading branch information
paoda committed Jul 3, 2023
1 parent 56c5f25 commit 722427b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/bench.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/trie.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
}
Expand Down Expand Up @@ -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) };
}
Expand Down

0 comments on commit 722427b

Please sign in to comment.