feat: add fileBacked
and purgeable
fields to process.getSystemMemoryInfo()
for macOS (#47628)
* fix: Optimize the value of memory.free in the return data of getSystemMemoryInfo(). * fix: Improve the value of memory in the return data of getSystemMemoryInfo(). * fix: complete API doc. * Update docs/api/process.md Co-authored-by: Will Anderson <will@itsananderson.com> * fix: update name to fileBacked. * fix: fix with code conflict --------- Co-authored-by: Will Anderson <will@itsananderson.com>
This commit is contained in:
parent
13d955a73e
commit
83a5ba1e2c
2 changed files with 8 additions and 1 deletions
|
@ -183,8 +183,11 @@ v8::Local<v8::Value> ElectronBindings::GetSystemMemoryInfo(
|
|||
#endif
|
||||
dict.Set("free", free.InKiB());
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
dict.Set("fileBacked", mem_info.file_backed.InKiB());
|
||||
dict.Set("purgeable", mem_info.purgeable.InKiB());
|
||||
#else
|
||||
// NB: These return bogus values on macOS
|
||||
#if !BUILDFLAG(IS_MAC)
|
||||
dict.Set("swapTotal", mem_info.swap_total.InKiB());
|
||||
dict.Set("swapFree", mem_info.swap_free.InKiB());
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue