Remove memory limit settings on macOS

This commit is contained in:
世界
2026-02-27 15:17:58 +08:00
parent b8979ea9ee
commit b92e63ef88
5 changed files with 3577 additions and 3563 deletions
+3 -1
View File
@@ -196,7 +196,9 @@ public class ExtensionProfile: ObservableObject {
let configContent = try await profile.readAsync()
options["configContent"] = NSString(string: configContent)
options["ignoreMemoryLimit"] = await NSNumber(value: SharedPreferences.ignoreMemoryLimit.get())
#if !os(macOS)
options["ignoreMemoryLimit"] = await NSNumber(value: SharedPreferences.ignoreMemoryLimit.get())
#endif
options["systemProxyEnabled"] = await NSNumber(value: SharedPreferences.systemProxyEnabled.get())
options["excludeDefaultRoute"] = await NSNumber(value: SharedPreferences.excludeDefaultRoute.get())
options["autoRouteUseSubRangesByDefault"] = await NSNumber(value: SharedPreferences.autoRouteUseSubRangesByDefault.get())
+4 -2
View File
@@ -155,8 +155,10 @@ open class ExtensionProvider: NEPacketTunnelProvider {
throw ExtensionStartupError("(packet-tunnel) redirect stderr error: \(stderrError.localizedDescription)")
}
let ignoreMemoryLimit = (effectiveOptions["ignoreMemoryLimit"] as? NSNumber)?.boolValue ?? false
LibboxSetMemoryLimit(!ignoreMemoryLimit)
#if !os(macOS)
let ignoreMemoryLimit = (effectiveOptions["ignoreMemoryLimit"] as? NSNumber)?.boolValue ?? false
LibboxSetMemoryLimit(!ignoreMemoryLimit)
#endif
var error: NSError?
commandServer = LibboxNewCommandServer(platformInterface, platformInterface, &error)