fix: moved DispatchSource.MemoryPressureEvent to custom RAMPressure enum. Fixed the crashes on some macs (#2212)

This commit is contained in:
Serhiy Mytrovtsiy
2024-11-14 17:00:19 +01:00
parent 354698a389
commit 3d0bfa456d
14 changed files with 65 additions and 43 deletions

View File

@@ -394,3 +394,20 @@ extension SizeUnit: CaseIterable {
}
}
}
public enum RAMPressure: String, Codable {
case normal
case warning
case critical
func pressureColor() -> NSColor {
switch self {
case .normal:
return NSColor.systemGreen
case .warning:
return NSColor.systemYellow
case .critical:
return NSColor.systemRed
}
}
}