Skip to content

Commit db96ad4

Browse files
GethDWandrewrk
authored andcommitted
std: fix Thread.Pool.spawn
`@alignCast` was required for args with greater alignment than that of a pointer.
1 parent 844da16 commit db96ad4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/std/Thread/Pool.zig

+1-1
Original file line numberDiff line numberDiff line change
@@ -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.

0 commit comments

Comments
 (0)