diff options
| author | ruki <[email protected]> | 2022-07-27 23:02:12 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-07-27 23:02:12 +0800 |
| commit | bbf97386cc97ce835b09462e46b0d097aedb92fc (patch) | |
| tree | d7d602a37ae6aaa8fddb202f70c1dd7480049299 /xmake/core/base/memory.lua | |
| parent | 557b2bf7b8326ecc440db1d67617bc8bae62959d (diff) | |
improve meminfo for macos
Diffstat (limited to 'xmake/core/base/memory.lua')
| -rw-r--r-- | xmake/core/base/memory.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/xmake/core/base/memory.lua b/xmake/core/base/memory.lua index da6f4b1af..5545e8c08 100644 --- a/xmake/core/base/memory.lua +++ b/xmake/core/base/memory.lua @@ -27,6 +27,9 @@ local os = require("base/os") -- get memory info function memory.info(name) local meminfo = os._meminfo() + if meminfo.vm_totalsize and meminfo.vm_availsize then + meminfo.vm_usagerate = (meminfo.vm_totalsize - meminfo.vm_availsize) / meminfo.vm_totalsize + end return name and meminfo[name] or meminfo end |
