From 57774f03325748cf6559c353e6795a5050e687ff Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Wed, 12 Oct 2022 00:00:00 -0500 Subject: [PATCH] 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 --- src/top/top.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/top/top.c b/src/top/top.c index 9ae7b1ba..e595cd84 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)));