diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-07-09 22:48:24 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-10-29 06:20:48 -0700 |
| commit | fd4dd3befb771b7ddd6c4f899a05ca18f91e1085 (patch) | |
| tree | 34ec4ac365697d8fc056da1ff35247272f7eb891 /lib/std/Io/EventLoop.zig | |
| parent | e1cbcecf89d9ac60f00b3d78c3d5ca7db0f35c5c (diff) | |
| download | zig-fd4dd3befb771b7ddd6c4f899a05ca18f91e1085.tar.gz zig-fd4dd3befb771b7ddd6c4f899a05ca18f91e1085.zip | |
update to sync with master
Diffstat (limited to 'lib/std/Io/EventLoop.zig')
| -rw-r--r-- | lib/std/Io/EventLoop.zig | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/std/Io/EventLoop.zig b/lib/std/Io/EventLoop.zig index 6f067821bf..8f9cfd658d 100644 --- a/lib/std/Io/EventLoop.zig +++ b/lib/std/Io/EventLoop.zig @@ -80,7 +80,7 @@ const Fiber = struct { ); fn allocate(el: *EventLoop) error{OutOfMemory}!*Fiber { - return @ptrCast(try el.gpa.alignedAlloc(u8, @alignOf(Fiber), allocation_size)); + return @ptrCast(try el.gpa.alignedAlloc(u8, .of(Fiber), allocation_size)); } fn allocatedSlice(f: *Fiber) []align(@alignOf(Fiber)) u8 { @@ -138,8 +138,8 @@ pub fn io(el: *EventLoop) Io { return .{ .userdata = el, .vtable = &.{ - .@"async" = @"async", - .@"await" = @"await", + .async = async, + .await = await, .go = go, .select = select, .cancel = cancel, @@ -166,7 +166,7 @@ pub fn io(el: *EventLoop) Io { pub fn init(el: *EventLoop, gpa: Allocator) !void { const threads_size = @max(std.Thread.getCpuCount() catch 1, 1) * @sizeOf(Thread); const idle_stack_end_offset = std.mem.alignForward(usize, threads_size + idle_stack_size, std.heap.page_size_max); - const allocated_slice = try gpa.alignedAlloc(u8, @alignOf(Thread), idle_stack_end_offset); + const allocated_slice = try gpa.alignedAlloc(u8, .of(Thread), idle_stack_end_offset); errdefer gpa.free(allocated_slice); el.* = .{ .gpa = gpa, @@ -697,7 +697,7 @@ const AsyncClosure = struct { } }; -fn @"async"( +fn async( userdata: ?*anyopaque, result: []u8, result_alignment: Alignment, @@ -835,7 +835,7 @@ fn go( event_loop.schedule(current_thread, .{ .head = fiber, .tail = fiber }); } -fn @"await"( +fn await( userdata: ?*anyopaque, any_future: *std.Io.AnyFuture, result: []u8, @@ -916,7 +916,7 @@ fn cancel( .resv = 0, }; }; - @"await"(userdata, any_future, result, result_alignment); + await(userdata, any_future, result, result_alignment); } fn cancelRequested(userdata: ?*anyopaque) bool { |
