fix(processes): 对齐活动监视器内存口径与显示单位

This commit is contained in:
2026-11-04 14:28:56 +08:00
parent 44f0415ab7
commit bbec1325a1
23 changed files with 195 additions and 26 deletions
+2 -2
View File
@@ -63,7 +63,7 @@ nonisolated struct ProcessMonitor: Sendable {
}
}
rows.append(ProcessMetrics(id: id, name: name, path: path,
cpu: usage, residentBytes: valid ? info.ptinfo.pti_resident_size : nil,
cpu: usage, footprintBytes: nil,
threads: valid ? Int(info.ptinfo.pti_threadnum) : nil, restricted: !valid))
}
// Recheck the enumeration identity after path reads; never attach a reused PID's path.
@@ -76,7 +76,7 @@ nonisolated struct ProcessMonitor: Sendable {
} else {
paths = [:]
rows = rows.map { ProcessMetrics(id: $0.id, name: $0.name, path: nil, cpu: $0.cpu,
residentBytes: $0.residentBytes, threads: $0.threads, restricted: $0.restricted) }
footprintBytes: $0.footprintBytes, threads: $0.threads, restricted: $0.restricted) }
}
let retained = Set(rows.map(\.id))
previous = next.filter { retained.contains($0.key) }