all repos — slstatus @ 0f9a1a836720c028d89891b85ec8b1dbbd12c485

my build of slstatus (tools.suckless.org/slstatus/)

updated ram_total and ram_free (obsd)
Tobias Tschinkowitz he4d@posteo.de
Wed, 16 May 2018 00:45:41 +0200
commit

0f9a1a836720c028d89891b85ec8b1dbbd12c485

parent

6464cea333144a5d0e3baa02c9c9ecad4b3c53bf

1 files changed, 4 insertions(+), 4 deletions(-)

jump to
M components/ram.ccomponents/ram.c

@@ -59,6 +59,8 @@ #include <sys/sysctl.h>

#include <sys/types.h> #include <unistd.h> + #define LOG1024 10 + inline int load_uvmexp(struct uvmexp *uvmexp) {

@@ -79,8 +81,7 @@ int free_pages;

if (load_uvmexp(&uvmexp)) { free_pages = uvmexp.npages - uvmexp.active; - free = (double) (free_pages * uvmexp.pagesize) / 1024 / - 1024 / 1024; + free = (float)(free_pages << (uvmexp.pageshift - LOG1024)) / 1024 / 1024; return bprintf("%f", free); }

@@ -108,8 +109,7 @@ struct uvmexp uvmexp;

float total; if (load_uvmexp(&uvmexp)) { - total = (double) (uvmexp.npages * uvmexp.pagesize) / - 1024 / 1024 / 1024; + total = (float)(uvmexp.npages << (uvmexp.pageshift - LOG1024)) / 1024 / 1024; return bprintf("%f", total); }