From: Ian Lance Taylor Date: Fri, 22 Oct 2021 21:19:34 +0000 (-0700) Subject: internal/poll: avoid tiny allocator for splicePipe X-Git-Tag: go1.18beta1~767 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=60c3069dd82eee30c00f2a8d829ba74b11bcf07e;p=gostls13.git internal/poll: avoid tiny allocator for splicePipe We want to set a finalizer on splicePipe, so make it large enough to not use the tiny allocator. Otherwise the finalizer will not run until the rest of the tiny allocation can be freed. This only matters on 32-bit systems. Fixes #48968 Change-Id: I8eb3c9f48fdccab7dc79c5b918d4257b6151ee91 Reviewed-on: https://go-review.googlesource.com/c/go/+/358114 Trust: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Go Bot Reviewed-by: Bryan C. Mills --- diff --git a/src/internal/poll/splice_linux.go b/src/internal/poll/splice_linux.go index 8062d98fae..6869a40b24 100644 --- a/src/internal/poll/splice_linux.go +++ b/src/internal/poll/splice_linux.go @@ -158,6 +158,10 @@ type splicePipe struct { rfd int wfd int data int + + // We want to use a finalizer, so ensure that the size is + // large enough to not use the tiny allocator. + _ [24 - 3*unsafe.Sizeof(int(0))]byte } // splicePipePool caches pipes to avoid high-frequency construction and destruction of pipe buffers.