mirror of
https://github.com/tailscale/tailscale.git
synced 2025-03-23 01:31:06 +00:00
wgengine/magicsock: allow even fewer allocs per UDP receive
We improved things again for Go 1.18. Lock that in. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
parent
c1d377078d
commit
1df865a580
@ -1341,11 +1341,15 @@ func TestReceiveFromAllocs(t *testing.T) {
|
||||
t.Skip("alloc tests are unreliable with -race")
|
||||
}
|
||||
// Go 1.16 and before: allow 3 allocs.
|
||||
// Go Tailscale fork, Go 1.17+: only allow 2 allocs.
|
||||
// Go 1.17: allow 2 allocs.
|
||||
// Go Tailscale fork, Go 1.18+: allow 1 alloc.
|
||||
major, ts := goMajorVersion(runtime.Version())
|
||||
maxAllocs := 3
|
||||
if major >= 17 || ts {
|
||||
switch {
|
||||
case major == 17:
|
||||
maxAllocs = 2
|
||||
case major >= 18, ts:
|
||||
maxAllocs = 1
|
||||
}
|
||||
t.Logf("allowing %d allocs for Go version %q", maxAllocs, runtime.Version())
|
||||
roundTrip := setUpReceiveFrom(t)
|
||||
|
Loading…
x
Reference in New Issue
Block a user