mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
update zig to 0.11 and update build script
Also update memcpy to avoid recursive memcpy due to optimizations.
This commit is contained in:
parent
0aaf8ebf8a
commit
2e2e609547
18 changed files with 535 additions and 507 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue