Compare commits

..

No commits in common. "2b9f82a5096440660d791c6fa97baae97a5d2843" and "f992575ad3a8dad05917e4ec381dd2dac3395c51" have entirely different histories.

3 changed files with 3 additions and 43 deletions

View File

@ -1,40 +0,0 @@
name: Nightly
on:
push:
paths:
- "**.zig"
branches:
- main
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: goto-bus-stop/setup-zig@v2
with:
version: master
- uses: actions/checkout@v3
- run: zig fmt src/**/*.zig
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{matrix.os}}
steps:
- uses: goto-bus-stop/setup-zig@v2
with:
version: master
- uses: actions/checkout@v3
- run: zig build test
bench:
runs-on: ubuntu-latest
steps:
- uses: goto-bus-stop/setup-zig@v2
with:
version: master
- uses: actions/checkout@v3
- run: zig build -Doptimize=ReleaseFast -Dcpu=baseline bench

View File

@ -18,7 +18,7 @@ const StringHashMap = std.hash_map.StringHashMap(void);
pub fn main() !void { pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){}; var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer std.debug.assert(gpa.deinit() == .ok); defer std.debug.assert(!gpa.deinit());
const allocator = gpa.allocator(); const allocator = gpa.allocator();
const elem_count = 1000; const elem_count = 1000;

View File

@ -45,7 +45,7 @@ pub fn HashArrayMappedTrie(comptime K: type, comptime V: type, comptime Context:
pub fn init(allocator: Allocator) !FreeList { pub fn init(allocator: Allocator) !FreeList {
const list = try allocator.create([table_size]?FreeList.Node); const list = try allocator.create([table_size]?FreeList.Node);
@memset(list, null); std.mem.set(?FreeList.Node, list, null);
return .{ .list = list }; return .{ .list = list };
} }
@ -147,7 +147,7 @@ pub fn HashArrayMappedTrie(comptime K: type, comptime V: type, comptime Context:
pub fn init(allocator: Allocator) !Self { pub fn init(allocator: Allocator) !Self {
// TODO: Add ability to have a larger root node (for quicker lookup times) // TODO: Add ability to have a larger root node (for quicker lookup times)
const root = try allocator.alloc(?*Node, table_size); const root = try allocator.alloc(?*Node, table_size);
@memset(root, null); std.mem.set(?*Node, root, null);
return Self{ .root = root, .free_list = try FreeList.init(allocator) }; return Self{ .root = root, .free_list = try FreeList.init(allocator) };
} }