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-07-20 10:38:39-07:00
log80d4655bb142c43275d9bb62d459295f9bea45bb
tree0765a9c10b649ee06afc12b4b97e9393f7cc10de
parent3f524ac5dc243585495bb16c15d00f13923fee6e

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 {
8080 );
8181
8282 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));
8484 }
8585
8686 fn allocatedSlice(f: *Fiber) []align(@alignOf(Fiber)) u8 {
......@@ -138,8 +138,8 @@ pub fn io(el: *EventLoop) Io {
138138 return .{
139139 .userdata = el,
140140 .vtable = &.{
141 .@"async" = @"async",
142 .@"await" = @"await",
141 .async = async,
142 .await = await,
143143 .go = go,
144144 .select = select,
145145 .cancel = cancel,
......@@ -166,7 +166,7 @@ pub fn io(el: *EventLoop) Io {
166166pub fn init(el: *EventLoop, gpa: Allocator) !void {
167167 const threads_size = @max(std.Thread.getCpuCount() catch 1, 1) * @sizeOf(Thread);
168168 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);
170170 errdefer gpa.free(allocated_slice);
171171 el.* = .{
172172 .gpa = gpa,
......@@ -697,7 +697,7 @@ const AsyncClosure = struct {
697697 }
698698};
699699
700fn @"async"(
700fn async(
701701 userdata: ?*anyopaque,
702702 result: []u8,
703703 result_alignment: Alignment,
......@@ -835,7 +835,7 @@ fn go(
835835 event_loop.schedule(current_thread, .{ .head = fiber, .tail = fiber });
836836}
837837
838fn @"await"(
838fn await(
839839 userdata: ?*anyopaque,
840840 any_future: *std.Io.AnyFuture,
841841 result: []u8,
......@@ -916,7 +916,7 @@ fn cancel(
916916 .resv = 0,
917917 };
918918 };
919 @"await"(userdata, any_future, result, result_alignment);
919 await(userdata, any_future, result, result_alignment);
920920}
921921
922922fn cancelRequested(userdata: ?*anyopaque) bool {
lib/std/Thread/Pool.zig+4-4
......@@ -330,8 +330,8 @@ pub fn io(pool: *Pool) Io {
330330 return .{
331331 .userdata = pool,
332332 .vtable = &.{
333 .@"async" = @"async",
334 .@"await" = @"await",
333 .async = async,
334 .await = await,
335335 .go = go,
336336 .cancel = cancel,
337337 .cancelRequested = cancelRequested,
......@@ -444,7 +444,7 @@ const AsyncClosure = struct {
444444 }
445445};
446446
447fn @"async"(
447fn async(
448448 userdata: ?*anyopaque,
449449 result: []u8,
450450 result_alignment: std.mem.Alignment,
......@@ -560,7 +560,7 @@ fn go(
560560 pool.cond.signal();
561561}
562562
563fn @"await"(
563fn await(
564564 userdata: ?*anyopaque,
565565 any_future: *std.Io.AnyFuture,
566566 result: []u8,