mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
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).
This commit is contained in:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user