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-07-20 10:38:39-07:00
log59270425aa78e0bd1d6fff50e4a7e55469547a63
tree35b88d3640283734f0f95f126abe82c22ac3f213
parent5aa3d1425ec9ec0fbcc3926987a2127af6802049

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