diff options
author | 2021-12-30 21:12:32 -0800 | |
---|---|---|
committer | 2021-12-30 21:12:32 -0800 | |
commit | e75c711c68896f5952793601f156c921c814caab (patch) | |
tree | f3b30e2281c7231d480bb84503d17b2370866ff9 /src/io/io_linux.zig | |
parent | 8d031f13c0e04629d431176e211a31224b7618c0 (diff) | |
download | bun-e75c711c68896f5952793601f156c921c814caab.tar.gz bun-e75c711c68896f5952793601f156c921c814caab.tar.zst bun-e75c711c68896f5952793601f156c921c814caab.zip |
Upgrade to latest Zig, remove dependency on patched version of Zig (#96)
* Prepare to upgrade zig
* zig fmt
* AllocGate
* Update data_url.zig
* wip
* few files
* just headers now?
* I think everything works?
* Update mimalloc
* Update hash_map.zig
* Perf improvements to compensate for Allocgate
* Bump
* :camera:
* Update bun.lockb
* Less branching
* [js parser] Slightly reduce memory usage
* Update js_parser.zig
* WIP remove unused
* [JS parser] WIP support for `with` keyword
* Remove more dead code
* Fix all the build errors!
* cleanup
* Move `network_thread` up
* Bump peechy
* Update README.md
Diffstat (limited to 'src/io/io_linux.zig')
-rw-r--r-- | src/io/io_linux.zig | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/io/io_linux.zig b/src/io/io_linux.zig index 05a39a4d7..5fd6aa709 100644 --- a/src/io/io_linux.zig +++ b/src/io/io_linux.zig @@ -234,10 +234,10 @@ pub const Completion = struct { result: i32 = undefined, next: ?*Completion = null, operation: Operation, - // This is one of the usecases for c_void outside of C code and as such c_void will + // This is one of the usecases for anyopaque outside of C code and as such anyopaque will // be replaced with anyopaque eventually: https://github.com/ziglang/zig/issues/323 - context: ?*c_void, - callback: fn (context: ?*c_void, completion: *Completion, result: *const c_void) void, + context: ?*anyopaque, + callback: fn (context: ?*anyopaque, completion: *Completion, result: *const anyopaque) void, fn prep(completion: *Completion, sqe: *io_uring_sqe) void { switch (completion.operation) { @@ -247,7 +247,7 @@ pub const Completion = struct { op.socket, &op.address, &op.address_size, - os.SOCK_CLOEXEC, + os.SOCK.CLOEXEC, ); }, .close => |op| { @@ -550,7 +550,7 @@ pub fn accept( .io = self, .context = context, .callback = struct { - fn wrapper(ctx: ?*c_void, comp: *Completion, res: *const c_void) void { + fn wrapper(ctx: ?*anyopaque, comp: *Completion, res: *const anyopaque) void { callback( @intToPtr(Context, @ptrToInt(ctx)), comp, @@ -592,7 +592,7 @@ pub fn close( .io = self, .context = context, .callback = struct { - fn wrapper(ctx: ?*c_void, comp: *Completion, res: *const c_void) void { + fn wrapper(ctx: ?*anyopaque, comp: *Completion, res: *const anyopaque) void { callback( @intToPtr(Context, @ptrToInt(ctx)), comp, @@ -642,7 +642,7 @@ pub fn connect( .io = self, .context = context, .callback = struct { - fn wrapper(ctx: ?*c_void, comp: *Completion, res: *const c_void) void { + fn wrapper(ctx: ?*anyopaque, comp: *Completion, res: *const anyopaque) void { callback( @intToPtr(Context, @ptrToInt(ctx)), comp, @@ -685,7 +685,7 @@ pub fn fsync( .io = self, .context = context, .callback = struct { - fn wrapper(ctx: ?*c_void, comp: *Completion, res: *const c_void) void { + fn wrapper(ctx: ?*anyopaque, comp: *Completion, res: *const anyopaque) void { callback( @intToPtr(Context, @ptrToInt(ctx)), comp, @@ -731,7 +731,7 @@ pub fn read( .io = self, .context = context, .callback = struct { - fn wrapper(ctx: ?*c_void, comp: *Completion, res: *const c_void) void { + fn wrapper(ctx: ?*anyopaque, comp: *Completion, res: *const anyopaque) void { callback( @intToPtr(Context, @ptrToInt(ctx)), comp, @@ -776,7 +776,7 @@ pub fn recv( .io = self, .context = context, .callback = struct { - fn wrapper(ctx: ?*c_void, comp: *Completion, res: *const c_void) void { + fn wrapper(ctx: ?*anyopaque, comp: *Completion, res: *const anyopaque) void { callback( @intToPtr(Context, @ptrToInt(ctx)), comp, @@ -827,7 +827,7 @@ pub fn send( .io = self, .context = context, .callback = struct { - fn wrapper(ctx: ?*c_void, comp: *Completion, res: *const c_void) void { + fn wrapper(ctx: ?*anyopaque, comp: *Completion, res: *const anyopaque) void { callback( @intToPtr(Context, @ptrToInt(ctx)), comp, @@ -863,7 +863,7 @@ pub fn timeout( .io = self, .context = context, .callback = struct { - fn wrapper(ctx: ?*c_void, comp: *Completion, res: *const c_void) void { + fn wrapper(ctx: ?*anyopaque, comp: *Completion, res: *const anyopaque) void { callback( @intToPtr(Context, @ptrToInt(ctx)), comp, @@ -912,7 +912,7 @@ pub fn write( .io = self, .context = context, .callback = struct { - fn wrapper(ctx: ?*c_void, comp: *Completion, res: *const c_void) void { + fn wrapper(ctx: ?*anyopaque, comp: *Completion, res: *const anyopaque) void { callback( @intToPtr(Context, @ptrToInt(ctx)), comp, @@ -945,7 +945,7 @@ fn buffer_limit(buffer_len: usize) usize { // stuffing the errno codes into the last `4096` values. // Darwin limits writes to `0x7fffffff` bytes, more than that returns `EINVAL`. // The corresponding POSIX limit is `std.math.maxInt(isize)`. - const limit = switch (std.Target.current.os.tag) { + const limit = switch (@import("builtin").target.os.tag) { .linux => 0x7ffff000, .macos, .ios, .watchos, .tvos => std.math.maxInt(i32), else => std.math.maxInt(isize), |