diff options
author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2023-01-07 17:46:15 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2023-01-07 19:30:23 +0100 |
commit | 560a04ad25c77a8c5bf4cec112a3d8da8df6272c (patch) | |
tree | 76bd2534fc2dae7c03bcd6fbbd815f21677e37df /freebsd | |
parent | 29f0b3c5e1184421ee7796ab2e1841733c45f403 (diff) |
Improve code readability by creating constants for memory values
Diffstat (limited to 'freebsd')
-rw-r--r-- | freebsd/Platform.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/freebsd/Platform.c b/freebsd/Platform.c index 1a731b71..3e8faaea 100644 --- a/freebsd/Platform.c +++ b/freebsd/Platform.c @@ -230,20 +230,20 @@ void Platform_setMemoryValues(Meter* this) { const FreeBSDProcessList* fpl = (const FreeBSDProcessList*) pl; this->total = pl->totalMem; - this->values[0] = pl->usedMem; - this->values[1] = pl->buffersMem; - // this->values[2] = "shared memory, like tmpfs and shm" - this->values[3] = pl->cachedMem; - // this->values[4] = "available memory" + this->values[MEMORY_METER_USED] = pl->usedMem; + this->values[MEMORY_METER_BUFFERS] = pl->buffersMem; + // this->values[MEMORY_METER_SHARED] = "shared memory, like tmpfs and shm" + this->values[MEMORY_METER_CACHE] = pl->cachedMem; + // this->values[MEMORY_METER_AVAILABLE] = "available memory" if (fpl->zfs.enabled) { // ZFS does not shrink below the value of zfs_arc_min. unsigned long long int shrinkableSize = 0; if (fpl->zfs.size > fpl->zfs.min) shrinkableSize = fpl->zfs.size - fpl->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; } } |