| ... | @@ -674,11 +674,6 @@ const PosixThreadImpl = struct { | ... | @@ -674,11 +674,6 @@ const PosixThreadImpl = struct { |
| 674 | | 674 | |
| 675 | const Instance = struct { | 675 | const Instance = struct { |
| 676 | fn entryFn(raw_arg: ?*anyopaque) callconv(.C) ?*anyopaque { | 676 | fn entryFn(raw_arg: ?*anyopaque) callconv(.C) ?*anyopaque { |
| 677 | // @alignCast() below doesn't support zero-sized-types (ZST) | | |
| 678 | if (@sizeOf(Args) < 1) { | | |
| 679 | return callFn(f, @as(Args, undefined)); | | |
| 680 | } | | |
| 681 | | | |
| 682 | const args_ptr: *Args = @ptrCast(@alignCast(raw_arg)); | 677 | const args_ptr: *Args = @ptrCast(@alignCast(raw_arg)); |
| 683 | defer allocator.destroy(args_ptr); | 678 | defer allocator.destroy(args_ptr); |
| 684 | return callFn(f, args_ptr.*); | 679 | return callFn(f, args_ptr.*); |
| ... | @@ -703,7 +698,7 @@ const PosixThreadImpl = struct { | ... | @@ -703,7 +698,7 @@ const PosixThreadImpl = struct { |
| 703 | &handle, | 698 | &handle, |
| 704 | &attr, | 699 | &attr, |
| 705 | Instance.entryFn, | 700 | Instance.entryFn, |
| 706 | if (@sizeOf(Args) > 1) @as(*anyopaque, @ptrCast(args_ptr)) else undefined, | 701 | @ptrCast(args_ptr), |
| 707 | )) { | 702 | )) { |
| 708 | .SUCCESS => return Impl{ .handle = handle }, | 703 | .SUCCESS => return Impl{ .handle = handle }, |
| 709 | .AGAIN => return error.SystemResources, | 704 | .AGAIN => return error.SystemResources, |