Update
This commit is contained in:
1 parent
3530afb854
commit
6903fcff27
2146 files changed
+112256
-190703
No files matched your search
+27
@@ -0,0 +1,27 @@
|
||||
// Copyright (c) Tailscale Inc & contributors
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
package wgcfg
|
||||
|
||||
import (
|
||||
"github.com/tailscale/wireguard-go/device"
|
||||
)
|
||||
|
||||
func getMemoryOptions() []device.Option {
|
||||
// iOS has a very restrictive memory limit on network extensions.
|
||||
// Reduce the maximum amount of memory that wireguard-go can allocate to
|
||||
// avoid getting killed.
|
||||
//
|
||||
// See _notios.go for a longer explanation of what the Queue{In,Out}boundSize
|
||||
// knobs control and the tradeoffs involved. Eventually Queue{In,Out}boundSize
|
||||
// should be CPU-scaled, and WithPreallocated... removed, but we keep them all
|
||||
// static for now, until the [device.WaitPool] ceiling is eliminated.
|
||||
// (See tailscale/corp#46396).
|
||||
return []device.Option{
|
||||
device.WithQueueStagedSize(64),
|
||||
device.WithQueueOutboundSize(64),
|
||||
device.WithQueueInboundSize(64),
|
||||
device.WithQueueHandshakeSize(64),
|
||||
device.WithPreallocatedBuffersPerPool(64),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user