mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
free freeing wrong amount in thread pool impl
This commit is contained in:
parent
1493c3b5f3
commit
08bb7c6c88
@ -396,6 +396,6 @@ pub fn @"await"(userdata: ?*anyopaque, any_future: *std.Io.AnyFuture, result: []
|
||||
const closure: *AsyncClosure = @ptrCast(@alignCast(any_future));
|
||||
closure.reset_event.wait();
|
||||
const base: [*]align(@alignOf(AsyncClosure)) u8 = @ptrCast(closure);
|
||||
@memcpy(result, (base + @sizeOf(AsyncClosure))[0..result.len]);
|
||||
thread_pool.allocator.free(base[0 .. @sizeOf(AsyncClosure) + result.len]);
|
||||
@memcpy(result, closure.resultPointer()[0..result.len]);
|
||||
thread_pool.allocator.free(base[0 .. closure.result_offset + result.len]);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user