mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 06:15:21 +00:00
std.Thread: fix mutable ref of temporary
The previous code is a compile error in stage2 as well as the upcoming lang spec.
This commit is contained in:
parent
9ecc47cd7c
commit
afe6e69e4c
@ -513,7 +513,8 @@ const WindowsThreadImpl = struct {
|
||||
errdefer assert(windows.kernel32.HeapFree(heap_handle, 0, alloc_ptr) != 0);
|
||||
|
||||
const instance_bytes = @ptrCast([*]u8, alloc_ptr)[0..alloc_bytes];
|
||||
const instance = std.heap.FixedBufferAllocator.init(instance_bytes).allocator().create(Instance) catch unreachable;
|
||||
var fba = std.heap.FixedBufferAllocator.init(instance_bytes);
|
||||
const instance = fba.allocator().create(Instance) catch unreachable;
|
||||
instance.* = .{
|
||||
.fn_args = args,
|
||||
.thread = .{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user