authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-03-31 14:57:12-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-02 16:30:59-07:00
log63b3a3d11c389a2cf617ed6d1a7b5a6b36991974
treeb5349ccfa1b81d3507ec92f03f0bc48bed945dbb
parent663611773ca5e6438fab82c4697bac6cc9b8e538

EventLoop: take DetachedClosure into account when allocating


1 files changed, 4 insertions(+), 4 deletions(-)

lib/std/Io/EventLoop.zig+4-4
......@@ -68,13 +68,13 @@ const Fiber = struct {
6868 const min_stack_size = 4 * 1024 * 1024;
6969 const max_context_align: Alignment = .@"16";
7070 const max_context_size = max_context_align.forward(1024);
71 const max_closure_size: usize = @max(@sizeOf(AsyncClosure), @sizeOf(DetachedClosure));
72 const max_closure_align: Alignment = .max(.of(AsyncClosure), .of(DetachedClosure));
7173 const allocation_size = std.mem.alignForward(
7274 usize,
73 std.mem.alignForward(
74 usize,
75 max_closure_align.max(max_context_align).forward(
7576 max_result_align.forward(@sizeOf(Fiber)) + max_result_size + min_stack_size,
76 @max(@alignOf(AsyncClosure), max_context_align.toByteUnits()),
77 ) + @sizeOf(AsyncClosure) + max_context_size,
77 ) + max_closure_size + max_context_size,
7878 std.heap.page_size_max,
7979 );
8080