added to git

This commit is contained in:
2026-08-10 22:27:53 -04:00
commit 815a663a2c
14 changed files with 802 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
#include "memUtil.h"
void get_mem_usage(int mem_total, char buf[PANE_BUF], int *mem_usages, int i) {
///_|> descry: return total mem usage
///_|> mem_total: total memory for use in calculations
///_|> buf: buffer to write pane to
///_|> mem_usages: data array
///_|> i: current datapoint in data array
///_|> returning: void
// Usage = total - unused
int mem_usage =
(int)min(mem_total, mem_total - get_file_line_value("/proc/meminfo", 2));
mem_usages[i] = (int)min((int)ceil(10.0 * mem_usage / mem_total), 10);
draw_mem_title(buf, (float)mem_usage / 1e6, (float)mem_total / 1e6);
draw_graph(buf, mem_usages, i);
}