Skip to content

Commit d75c20a

Browse files
committed
Updated to 1.1.4 reflecting updates for Zig 1.15 and changes to target selection
1 parent 35112cb commit d75c20a

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ If you're looking to run Lua on LuaJIT in your Zig application, you're probably
3535

3636
## Zig Version
3737

38-
The `main` branch targets Zig's `master` (nightly) deployment (last tested with `0.14.0-dev.3460+6d29ef0ba`).
38+
The `main` branch targets Zig's `master` (nightly) deployment (last tested with `0.15.0-dev.565+8e72a2528`).
3939

4040
## Installation & Usage
4141

build.zig.zon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.{
22
.name = .luajit_build,
33
.fingerprint = 0x7f498d6f53e8581c,
4-
.version = "1.1.3",
4+
.version = "1.1.4",
55
.dependencies = .{
66
.upstream = .{
77
.url = "git+https://github.com/LuaJIT/LuaJIT#538a82133ad6fddfd0ca64de167c4aca3bc1a2da",

examples/simple-repl/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ language bindings to LuaJIT, kindly refer to one of the following projects:
1010

1111
## Version
1212

13-
Last tested with Zig version `0.14.0-dev.3460+6d29ef0ba`
13+
Last tested with Zig version `0.15.0-dev.565+8e72a2528`
1414

1515
## Usage
1616

examples/simple-repl/main.zig

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@ pub fn main() !void {
4444
}
4545
}
4646

47-
const max = @alignOf(std.c.max_align_t);
47+
const max_alignment: std.mem.Alignment = std.mem.Alignment.of(std.c.max_align_t);
48+
const max_alignment_bytes: usize = std.mem.Alignment.toByteUnits(max_alignment);
4849
const NativeAllocator = struct {
49-
fn alloc(ud: ?*anyopaque, ptr: ?*anyopaque, osize: usize, nsize: usize) callconv(.c) ?*align(max) anyopaque {
50+
fn alloc(ud: ?*anyopaque, ptr: ?*anyopaque, osize: usize, nsize: usize) callconv(.c) ?*align(max_alignment_bytes) anyopaque {
5051
const allocator: *std.mem.Allocator = @ptrCast(@alignCast(ud.?));
51-
const aligned_ptr = @as(?[*]align(max) u8, @ptrCast(@alignCast(ptr)));
52+
const aligned_ptr = @as(?[*]align(max_alignment_bytes) u8, @ptrCast(@alignCast(ptr)));
5253
if (aligned_ptr) |p| {
5354
if (nsize != 0) {
5455
const old_mem = p[0..osize];
@@ -59,7 +60,7 @@ const NativeAllocator = struct {
5960
return null;
6061
} else {
6162
// Malloc case
62-
return (allocator.alignedAlloc(u8, max, nsize) catch return null).ptr;
63+
return (allocator.alignedAlloc(u8, max_alignment, nsize) catch return null).ptr;
6364
}
6465
}
6566
};

0 commit comments

Comments
 (0)