feat(memory): 重设计内存卡片并统一二进制容量单位

This commit is contained in:
2026-11-03 16:51:14 +08:00
parent cc38066de2
commit 90ed18e6ac
11 changed files with 186 additions and 17 deletions
+3
View File
@@ -14,6 +14,9 @@ nonisolated struct MemoryMetrics: Sendable {
let compressed: UInt64
let swapUsed: UInt64?
let pressure: Int?
var cached: UInt64? = nil
var available: UInt64 { total - min(total, used) }
var app: UInt64 { used - min(used, wired + compressed) }
var usage: Double { total == 0 ? 0 : Double(used) / Double(total) }
}