authorgravatar for gethwilliams@googlemail.comGethDW <gethwilliams@googlemail.com> 2024-04-19 16:10:58+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-04-19 13:49:06-07:00
logdb96ad4a16a2251c5b0ed07a25a8a617e2399d9d
treeae8c576010cde7f59408e8c96e7efb455aca240a
parent844da16d8e67ad97c4eb8b2251734d69cb018cae

std: fix Thread.Pool.spawn

`@alignCast` was required for args with greater alignment than that of a pointer.

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

lib/std/Thread/Pool.zig+1-1
......@@ -89,7 +89,7 @@ pub fn spawn(pool: *Pool, comptime func: anytype, args: anytype) !void {
8989
9090 fn runFn(runnable: *Runnable) void {
9191 const run_node: *RunQueue.Node = @fieldParentPtr("data", runnable);
92 const closure: *@This() = @fieldParentPtr("run_node", run_node);
92 const closure: *@This() = @alignCast(@fieldParentPtr("run_node", run_node));
9393 @call(.auto, func, closure.arguments);
9494
9595 // The thread pool's allocator is protected by the mutex.