Skip to content

Commit

Permalink
zig 0.14.0-dev.1710+8ee52f99c
Browse files Browse the repository at this point in the history
  • Loading branch information
Senryoku committed Oct 6, 2024
1 parent d3cb5f5 commit 6b9eda6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/zig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ jobs:
- uses: actions/checkout@v4
- uses: goto-bus-stop/setup-zig@v2
with:
version: 0.13.0
version: 0.14.0-dev.1710+8ee52f99c
- run: zig build test --summary all
- run: zig build test --fuzz --summary all
lint:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .zigversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.13.0
0.14.0-dev.1710+8ee52f99c
12 changes: 1 addition & 11 deletions src/lzw.zig
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,7 @@ test "basic" {

test "fuzzing" {
// Doesn't ensure that the string is valid UTF-8, but it should not matter.
// Note: In the future, use std.testing.random_seed. See https://github.com/ziglang/zig/issues/17609.
const seed = std.crypto.random.int(u64);
errdefer std.debug.print("\nFuzzing Test FAILED\n\tSeed: {d}\n", .{seed});
var rng = std.rand.DefaultPrng.init(seed);
for (0..10) |_| {
const length = rng.random().intRangeAtMost(usize, 0, 10_000_000); // Up to ~10MB
const str = try std.testing.allocator.alloc(u8, length);
defer std.testing.allocator.free(str);
rng.fill(str);
try testRound(str);
}
return std.testing.fuzz(testRound, .{});
}

fn testFile(path: []const u8) !void {
Expand Down
6 changes: 3 additions & 3 deletions src/wasm.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const impl = @import("lzw.zig");

const wasmAllocator = @import("./wasmAllocator.zig");
comptime {
@export(wasmAllocator.allocUint8, .{ .name = "allocUint8", .linkage = .strong });
@export(wasmAllocator.allocUint16, .{ .name = "allocUint16", .linkage = .strong });
@export(wasmAllocator.free, .{ .name = "free", .linkage = .strong });
@export(&wasmAllocator.allocUint8, .{ .name = "allocUint8", .linkage = .strong });
@export(&wasmAllocator.allocUint16, .{ .name = "allocUint16", .linkage = .strong });
@export(&wasmAllocator.free, .{ .name = "free", .linkage = .strong });
}

comptime {
Expand Down
Binary file modified ts-lib/src/module.wasm
Binary file not shown.

0 comments on commit 6b9eda6

Please sign in to comment.