Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
zig: ["0.14.0", "0.15.0-dev.375+8f8f37fb0"]

runs-on: ${{matrix.os}}

steps:
Expand All @@ -20,7 +22,7 @@ jobs:
- name: Setup Zig
uses: mlugg/setup-zig@v1
with:
version: 0.15.0-dev.375+8f8f37fb0
version: ${{ matrix.zig }}

- name: Run tests
run: make test
6 changes: 5 additions & 1 deletion src/lib.zig
Original file line number Diff line number Diff line change
Expand Up @@ -613,8 +613,12 @@ pub const Lua = opaque {
} else if (nsize == 0) {
return null;
} else {
const builtin = @import("builtin"); // FIXME: remove when zig-0.15 is released and 0.14 can be dropped
// ptr is null, allocate a new block of memory
const new_ptr = allocator_ptr.alignedAlloc(u8, .fromByteUnits(alignment), nsize) catch return null;
const new_ptr = (if (builtin.zig_version.major == 0 and builtin.zig_version.minor < 15)
allocator_ptr.alignedAlloc(u8, alignment, nsize)
else
allocator_ptr.alignedAlloc(u8, .fromByteUnits(alignment), nsize)) catch return null;
return new_ptr.ptr;
}
}
Expand Down
Loading