We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b45611 commit 9c7fa35Copy full SHA for 9c7fa35
lib/std/Thread.zig
@@ -674,11 +674,6 @@ const PosixThreadImpl = struct {
674
675
const Instance = struct {
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));
683
defer allocator.destroy(args_ptr);
684
return callFn(f, args_ptr.*);
@@ -703,7 +698,7 @@ const PosixThreadImpl = struct {
703
698
&handle,
704
699
&attr,
705
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 },
709
.AGAIN => return error.SystemResources,
0 commit comments