| ... | @@ -80,7 +80,7 @@ const Fiber = struct { | ... | @@ -80,7 +80,7 @@ const Fiber = struct { |
| 80 | ); | 80 | ); |
| 81 | | 81 | |
| 82 | fn allocate(el: *EventLoop) error{OutOfMemory}!*Fiber { | 82 | fn allocate(el: *EventLoop) error{OutOfMemory}!*Fiber { |
| 83 | return @ptrCast(try el.gpa.alignedAlloc(u8, @alignOf(Fiber), allocation_size)); | 83 | return @ptrCast(try el.gpa.alignedAlloc(u8, .of(Fiber), allocation_size)); |
| 84 | } | 84 | } |
| 85 | | 85 | |
| 86 | fn allocatedSlice(f: *Fiber) []align(@alignOf(Fiber)) u8 { | 86 | fn allocatedSlice(f: *Fiber) []align(@alignOf(Fiber)) u8 { |
| ... | @@ -138,8 +138,8 @@ pub fn io(el: *EventLoop) Io { | ... | @@ -138,8 +138,8 @@ pub fn io(el: *EventLoop) Io { |
| 138 | return .{ | 138 | return .{ |
| 139 | .userdata = el, | 139 | .userdata = el, |
| 140 | .vtable = &.{ | 140 | .vtable = &.{ |
| 141 | .@"async" = @"async", | 141 | .async = async, |
| 142 | .@"await" = @"await", | 142 | .await = await, |
| 143 | .go = go, | 143 | .go = go, |
| 144 | .select = select, | 144 | .select = select, |
| 145 | .cancel = cancel, | 145 | .cancel = cancel, |
| ... | @@ -166,7 +166,7 @@ pub fn io(el: *EventLoop) Io { | ... | @@ -166,7 +166,7 @@ pub fn io(el: *EventLoop) Io { |
| 166 | pub fn init(el: *EventLoop, gpa: Allocator) !void { | 166 | pub fn init(el: *EventLoop, gpa: Allocator) !void { |
| 167 | const threads_size = @max(std.Thread.getCpuCount() catch 1, 1) * @sizeOf(Thread); | 167 | const threads_size = @max(std.Thread.getCpuCount() catch 1, 1) * @sizeOf(Thread); |
| 168 | const idle_stack_end_offset = std.mem.alignForward(usize, threads_size + idle_stack_size, std.heap.page_size_max); | 168 | const idle_stack_end_offset = std.mem.alignForward(usize, threads_size + idle_stack_size, std.heap.page_size_max); |
| 169 | const allocated_slice = try gpa.alignedAlloc(u8, @alignOf(Thread), idle_stack_end_offset); | 169 | const allocated_slice = try gpa.alignedAlloc(u8, .of(Thread), idle_stack_end_offset); |
| 170 | errdefer gpa.free(allocated_slice); | 170 | errdefer gpa.free(allocated_slice); |
| 171 | el.* = .{ | 171 | el.* = .{ |
| 172 | .gpa = gpa, | 172 | .gpa = gpa, |
| ... | @@ -697,7 +697,7 @@ const AsyncClosure = struct { | ... | @@ -697,7 +697,7 @@ const AsyncClosure = struct { |
| 697 | } | 697 | } |
| 698 | }; | 698 | }; |
| 699 | | 699 | |
| 700 | fn @"async"( | 700 | fn async( |
| 701 | userdata: ?*anyopaque, | 701 | userdata: ?*anyopaque, |
| 702 | result: []u8, | 702 | result: []u8, |
| 703 | result_alignment: Alignment, | 703 | result_alignment: Alignment, |
| ... | @@ -835,7 +835,7 @@ fn go( | ... | @@ -835,7 +835,7 @@ fn go( |
| 835 | event_loop.schedule(current_thread, .{ .head = fiber, .tail = fiber }); | 835 | event_loop.schedule(current_thread, .{ .head = fiber, .tail = fiber }); |
| 836 | } | 836 | } |
| 837 | | 837 | |
| 838 | fn @"await"( | 838 | fn await( |
| 839 | userdata: ?*anyopaque, | 839 | userdata: ?*anyopaque, |
| 840 | any_future: *std.Io.AnyFuture, | 840 | any_future: *std.Io.AnyFuture, |
| 841 | result: []u8, | 841 | result: []u8, |
| ... | @@ -916,7 +916,7 @@ fn cancel( | ... | @@ -916,7 +916,7 @@ fn cancel( |
| 916 | .resv = 0, | 916 | .resv = 0, |
| 917 | }; | 917 | }; |
| 918 | }; | 918 | }; |
| 919 | @"await"(userdata, any_future, result, result_alignment); | 919 | await(userdata, any_future, result, result_alignment); |
| 920 | } | 920 | } |
| 921 | | 921 | |
| 922 | fn cancelRequested(userdata: ?*anyopaque) bool { | 922 | fn cancelRequested(userdata: ?*anyopaque) bool { |