summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Warner <james.warner@comcast.net>2022-10-12 00:00:00 -0500
committerCraig Small <csmall@dropbear.xyz>2022-10-16 19:56:19 +1100
commit57774f03325748cf6559c353e6795a5050e687ff (patch)
tree47eabd9b3be58998632178b1bd1d1290922e7f29 /src
parent244f2b33f279c6615110c04c6fce56db8a2c1eb0 (diff)
downloadprocps-ng-57774f03325748cf6559c353e6795a5050e687ff.tar.gz
top: restore missing support for 'MEMGRAPH_OLD' define
When support for graphs was refactored, in that commit referenced below, the logic for our 'MEMGRAPH_OLD' was lost while the #define itself remained in the .h file. Faced with deleting the #define or restoring the logic I chose the latter. Thus, if one wanted to be reminded how overstated 'used' memory once was, it can be done. Reference(s): . Sep, 2022 - refactored graph support commit 2d5b51d1a2aa19d077a2f3db5be187f982d70e70 Signed-off-by: Jim Warner <james.warner@comcast.net>
Diffstat (limited to 'src')
-rw-r--r--src/top/top.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/top/top.c b/src/top/top.c
index 9ae7b1b..e595cd8 100644
--- a/src/top/top.c
+++ b/src/top/top.c
@@ -6571,12 +6571,15 @@ static void do_memory (void) {
my_qued = MEM_VAL(mem_BUF) + MEM_VAL(mem_QUE);
if (Curwin->rc.graph_mems) {
- my_misc = MEM_VAL(mem_TOT) - MEM_VAL(mem_FRE) - my_qued;
- my_used = MEM_VAL(mem_TOT) - MEM_VAL(mem_AVL) - my_misc;
-
+ my_used = MEM_VAL(mem_TOT) - MEM_VAL(mem_FRE) - my_qued;
+#ifdef MEMGRAPH_OLD
+ my_misc = my_qued;
+#else
+ my_misc = MEM_VAL(mem_TOT) - MEM_VAL(mem_AVL) - my_used;
+#endif
Graph_mems->total = MEM_VAL(mem_TOT);
- Graph_mems->part1 = my_misc;
- Graph_mems->part2 = my_used;
+ Graph_mems->part1 = my_used;
+ Graph_mems->part2 = my_misc;
rx = sum_rx(Graph_mems);
#ifdef TOG4_MEM_1UP
prT(bfT(0), mkM(MEM_VAL(mem_TOT)));