feat: add fileBacked and purgeable fields to process.getSystemMemoryInfo() for macOS (#48146)

feat: add fileBacked and purgeable fields to process.getSystemMemoryInfo() for macOS
This commit is contained in:
BILL SHEN 2025-08-29 01:57:06 +08:00 committed by GitHub
commit 441cff700b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View file

@ -183,8 +183,11 @@ v8::Local<v8::Value> ElectronBindings::GetSystemMemoryInfo(
#endif
dict.Set("free", free);
#if BUILDFLAG(IS_MAC)
dict.Set("fileBacked", mem_info.file_backed);
dict.Set("purgeable", mem_info.purgeable);
#else
// NB: These return bogus values on macOS
#if !BUILDFLAG(IS_MAC)
dict.Set("swapTotal", mem_info.swap_total);
dict.Set("swapFree", mem_info.swap_free);
#endif