summaryrefslogtreecommitdiffstats
path: root/linux/Platform.c
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2023-01-07 17:46:15 +0100
committerBenBE <BenBE@geshi.org>2023-01-07 19:30:23 +0100
commit560a04ad25c77a8c5bf4cec112a3d8da8df6272c (patch)
tree76bd2534fc2dae7c03bcd6fbbd815f21677e37df /linux/Platform.c
parent29f0b3c5e1184421ee7796ab2e1841733c45f403 (diff)
Improve code readability by creating constants for memory values
Diffstat (limited to 'linux/Platform.c')
-rw-r--r--linux/Platform.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/linux/Platform.c b/linux/Platform.c
index f9cd4d50..8c608d6d 100644
--- a/linux/Platform.c
+++ b/linux/Platform.c
@@ -351,20 +351,20 @@ void Platform_setMemoryValues(Meter* this) {
const LinuxProcessList* lpl = (const LinuxProcessList*) pl;
this->total = pl->totalMem;
- this->values[0] = pl->usedMem;
- this->values[1] = pl->buffersMem;
- this->values[2] = pl->sharedMem;
- this->values[3] = pl->cachedMem;
- this->values[4] = pl->availableMem;
+ this->values[MEMORY_METER_USED] = pl->usedMem;
+ this->values[MEMORY_METER_BUFFERS] = pl->buffersMem;
+ this->values[MEMORY_METER_SHARED] = pl->sharedMem;
+ this->values[MEMORY_METER_CACHE] = pl->cachedMem;
+ this->values[MEMORY_METER_AVAILABLE] = pl->availableMem;
if (lpl->zfs.enabled != 0 && !Running_containerized) {
// ZFS does not shrink below the value of zfs_arc_min.
unsigned long long int shrinkableSize = 0;
if (lpl->zfs.size > lpl->zfs.min)
shrinkableSize = lpl->zfs.size - lpl->zfs.min;
- this->values[0] -= shrinkableSize;
- this->values[3] += shrinkableSize;
- this->values[4] += shrinkableSize;
+ this->values[MEMORY_METER_USED] -= shrinkableSize;
+ this->values[MEMORY_METER_CACHE] += shrinkableSize;
+ this->values[MEMORY_METER_AVAILABLE] += shrinkableSize;
}
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy