diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-01-06 18:11:24 +0100 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2021-02-07 12:41:52 +0100 |
commit | 3d497a3760626d398fffc8f4594e8b9658f67d55 (patch) | |
tree | 31f5f760e5039d220606461929ac48f365aff269 /ProcessList.h | |
parent | 0d67263b36f0f1b45a2f10ec80c15766ca218ce5 (diff) |
Linux: overhaul memory partition
Use similar calculation than procps.
Show AvailableMemory in text mode.
Use total minus available memory instead of manually computed used-
memory as fraction part in bar mode (if available).
Diffstat (limited to 'ProcessList.h')
-rw-r--r-- | ProcessList.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/ProcessList.h b/ProcessList.h index cb17f0d7..3cd10a4e 100644 --- a/ProcessList.h +++ b/ProcessList.h @@ -34,6 +34,9 @@ in the source distribution for its full text. #define MAX_READ 2048 #endif +typedef unsigned long long int memory_t; +#define MEMORY_MAX ULLONG_MAX + typedef struct ProcessList_ { const Settings* settings; @@ -61,14 +64,15 @@ typedef struct ProcessList_ { int userlandThreads; int kernelThreads; - unsigned long long int totalMem; - unsigned long long int usedMem; - unsigned long long int buffersMem; - unsigned long long int cachedMem; + memory_t totalMem; + memory_t usedMem; + memory_t buffersMem; + memory_t cachedMem; + memory_t availableMem; - unsigned long long int totalSwap; - unsigned long long int usedSwap; - unsigned long long int cachedSwap; + memory_t totalSwap; + memory_t usedSwap; + memory_t cachedSwap; int cpuCount; |