diff options
author | Kevin Bracey <kevin@bracey.fi> | 2022-01-09 13:27:52 +0200 |
---|---|---|
committer | Ivan Shapovalov <intelfx@intelfx.name> | 2023-10-26 03:14:33 +0400 |
commit | 69a505d69cb69018b1581103e0dcbab5f7a0d6b1 (patch) | |
tree | 0353879bf12086f2bccde9140aa08a4d1966f186 /MemoryMeter.c | |
parent | 09934e6630621f05e8c339c0633ef9eb24f1fc2c (diff) |
Move shared memory next to used memory
Shared memory is less available than buffers, so move it
left next to used memory.
This is in preparation for including shared memory in the
basic "in use" for the bar text. It would not make sense
to sum a discontiguous region.
Diffstat (limited to 'MemoryMeter.c')
-rw-r--r-- | MemoryMeter.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/MemoryMeter.c b/MemoryMeter.c index c7d99f88..3ddb0438 100644 --- a/MemoryMeter.c +++ b/MemoryMeter.c @@ -19,9 +19,9 @@ in the source distribution for its full text. static const int MemoryMeter_attributes[] = { MEMORY_USED, - MEMORY_BUFFERS, MEMORY_SHARED, MEMORY_COMPRESSED, + MEMORY_BUFFERS, MEMORY_CACHE }; @@ -66,10 +66,6 @@ static void MemoryMeter_display(const Object* cast, RichString* out) { RichString_appendAscii(out, CRT_colors[METER_TEXT], " used:"); RichString_appendAscii(out, CRT_colors[MEMORY_USED], buffer); - Meter_humanUnit(buffer, this->values[MEMORY_METER_BUFFERS], sizeof(buffer)); - RichString_appendAscii(out, CRT_colors[METER_TEXT], " buffers:"); - RichString_appendAscii(out, CRT_colors[MEMORY_BUFFERS_TEXT], buffer); - /* shared memory is not supported on all platforms */ if (isNonnegative(this->values[MEMORY_METER_SHARED])) { Meter_humanUnit(buffer, this->values[MEMORY_METER_SHARED], sizeof(buffer)); @@ -84,6 +80,10 @@ static void MemoryMeter_display(const Object* cast, RichString* out) { RichString_appendAscii(out, CRT_colors[MEMORY_COMPRESSED], buffer); } + Meter_humanUnit(buffer, this->values[MEMORY_METER_BUFFERS], sizeof(buffer)); + RichString_appendAscii(out, CRT_colors[METER_TEXT], " buffers:"); + RichString_appendAscii(out, CRT_colors[MEMORY_BUFFERS_TEXT], buffer); + Meter_humanUnit(buffer, this->values[MEMORY_METER_CACHE], sizeof(buffer)); RichString_appendAscii(out, CRT_colors[METER_TEXT], " cache:"); RichString_appendAscii(out, CRT_colors[MEMORY_CACHE], buffer); |