update zig to 0.11 and update build script

Also update memcpy to avoid recursive memcpy due to optimizations.
This commit is contained in:
Brendan Hansknecht 2023-09-20 14:42:11 -07:00
parent 0aaf8ebf8a
commit 2e2e609547
No known key found for this signature in database
GPG key ID: 0EA784685083E75B
18 changed files with 535 additions and 507 deletions

View file

@ -29,7 +29,7 @@ pub fn expectFailedStartSharedFile() callconv(.C) [*]u8 {
_ = std.fmt.bufPrint(name[0..100], "/roc_expect_buffer_{}\x00", .{roc_getppid()}) catch unreachable;
if (builtin.os.tag == .macos or builtin.os.tag == .linux) {
const shared_fd = roc_shm_open(@ptrCast(*const i8, &name), O_RDWR | O_CREAT, 0o666);
const shared_fd = roc_shm_open(@as(*const i8, @ptrCast(&name)), O_RDWR | O_CREAT, 0o666);
const length = 4096;
@ -42,7 +42,7 @@ pub fn expectFailedStartSharedFile() callconv(.C) [*]u8 {
0,
);
const ptr = @ptrCast([*]u8, shared_ptr);
const ptr = @as([*]u8, @ptrCast(shared_ptr));
return ptr;
} else {
@ -61,7 +61,7 @@ pub fn readSharedBufferEnv() callconv(.C) void {
var name: [100]u8 = undefined;
_ = std.fmt.bufPrint(name[0..100], "/roc_expect_buffer_{}\x00", .{roc_getppid()}) catch unreachable;
const shared_fd = roc_shm_open(@ptrCast(*const i8, &name), O_RDWR | O_CREAT, 0o666);
const shared_fd = roc_shm_open(@as(*const i8, @ptrCast(&name)), O_RDWR | O_CREAT, 0o666);
const length = 4096;
const shared_ptr = roc_mmap(
@ -73,7 +73,7 @@ pub fn readSharedBufferEnv() callconv(.C) void {
0,
);
const ptr = @ptrCast([*]u8, shared_ptr);
const ptr = @as([*]u8, @ptrCast(shared_ptr));
SHARED_BUFFER = ptr[0..length];
}
@ -81,8 +81,8 @@ pub fn readSharedBufferEnv() callconv(.C) void {
pub fn notifyParent(shared_buffer: [*]u8, tag: u32) callconv(.C) void {
if (builtin.os.tag == .macos or builtin.os.tag == .linux) {
const usize_ptr = @ptrCast([*]u32, @alignCast(@alignOf(usize), shared_buffer));
const atomic_ptr = @ptrCast(*Atomic(u32), &usize_ptr[5]);
const usize_ptr = @as([*]u32, @ptrCast(@alignCast(shared_buffer)));
const atomic_ptr = @as(*Atomic(u32), @ptrCast(&usize_ptr[5]));
atomic_ptr.storeUnchecked(tag);
// wait till the parent is done before proceeding