authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-07-09 22:48:24-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-02 16:30:59-07:00
logfdd59f0fa73e5c2590b3bdd4a61e5e2e65557867
treea1b7109e9fb13b464f255677720a7fc6addb8371
parent0c0ea7844eaa4de5d470cb9c20d4af1e22032400

update to sync with master


2 files changed, 11 insertions(+), 11 deletions(-)

lib/std/Io/EventLoop.zig+7-7
...@@ -80,7 +80,7 @@ const Fiber = struct {...@@ -80,7 +80,7 @@ const Fiber = struct {
80 );80 );
8181
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 }
8585
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 {
166pub fn init(el: *EventLoop, gpa: Allocator) !void {166pub 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};
699699
700fn @"async"(700fn 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}
837837
838fn @"await"(838fn 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}
921921
922fn cancelRequested(userdata: ?*anyopaque) bool {922fn cancelRequested(userdata: ?*anyopaque) bool {
lib/std/Thread/Pool.zig+4-4
...@@ -330,8 +330,8 @@ pub fn io(pool: *Pool) Io {...@@ -330,8 +330,8 @@ pub fn io(pool: *Pool) Io {
330 return .{330 return .{
331 .userdata = pool,331 .userdata = pool,
332 .vtable = &.{332 .vtable = &.{
333 .@"async" = @"async",333 .async = async,
334 .@"await" = @"await",334 .await = await,
335 .go = go,335 .go = go,
336 .cancel = cancel,336 .cancel = cancel,
337 .cancelRequested = cancelRequested,337 .cancelRequested = cancelRequested,
...@@ -444,7 +444,7 @@ const AsyncClosure = struct {...@@ -444,7 +444,7 @@ const AsyncClosure = struct {
444 }444 }
445};445};
446446
447fn @"async"(447fn async(
448 userdata: ?*anyopaque,448 userdata: ?*anyopaque,
449 result: []u8,449 result: []u8,
450 result_alignment: std.mem.Alignment,450 result_alignment: std.mem.Alignment,
...@@ -560,7 +560,7 @@ fn go(...@@ -560,7 +560,7 @@ fn go(
560 pool.cond.signal();560 pool.cond.signal();
561}561}
562562
563fn @"await"(563fn await(
564 userdata: ?*anyopaque,564 userdata: ?*anyopaque,
565 any_future: *std.Io.AnyFuture,565 any_future: *std.Io.AnyFuture,
566 result: []u8,566 result: []u8,