]> Cypherpunks repositories - gostls13.git/commit
internal/poll: remove operation fields from FD
authorqmuntal <quimmuntal@gmail.com>
Tue, 16 Sep 2025 12:12:25 +0000 (14:12 +0200)
committerQuim Muntal <quimmuntal@gmail.com>
Tue, 30 Sep 2025 07:16:48 +0000 (00:16 -0700)
commitdb10db6be361f4eaf5f81890e487a9cbf3ca5a53
treebca54cc7a551d84d5e559d59924001276cac06c4
parent75c87df58ebfb24592d7002ef71912f8708dc424
internal/poll: remove operation fields from FD

Use a sync.Pool to reuse the overlapped object passed to the different
Windows syscalls instead of keeping two of them in the FD struct.

This reduces the size of the FD struct from 248 to 152 bytes.

While here, pin the overlapped object for the duration of the overlapped
IO operation to comply with the memory safety rules.

Cq-Include-Trybots: luci.golang.try:gotip-windows-amd64-longtest,gotip-windows-amd64-race
Change-Id: I0161d163f681fe94b822c0c885aaa42c449e5342
Reviewed-on: https://go-review.googlesource.com/c/go/+/704235
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
src/internal/poll/fd_windows.go