From 93a60022dcae32af9d8e05fd9a3c57c30a5a9668 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Wed, 11 May 2016 17:17:17 -0500 Subject: [PATCH] library: ain't like your father's delta, api When the code for DELTA values (among other stuff) was stolen from the recently revised interface, the concept of ever growing values was propagated too. But here we must manage both growing and shrinking values. Thus former protections against a negative delta don't have any place in this module and are hereby banished. Signed-off-by: Jim Warner --- proc/meminfo.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/proc/meminfo.c b/proc/meminfo.c index b3a3e56d..ba6cad51 100644 --- a/proc/meminfo.c +++ b/proc/meminfo.c @@ -124,8 +124,7 @@ struct procps_meminfo { // regular assignment #define MEM_set(e,t,x) setDECL(e) { R->result. t = H->new . x; } // delta assignment -#define HST_set(e,t,x) setDECL(e) { R->result. t = ( H->new . x - H->old. x ); \ - if (R->result. t < 0) R->result. t = 0; } +#define HST_set(e,t,x) setDECL(e) { R->result. t = ( H->new . x - H->old. x ); } setDECL(noop) { (void)R; (void)H; } setDECL(extra) { (void)R; (void)H; } @@ -233,8 +232,7 @@ MEM_set(SWAP_USED, ul_int, derived_swap_used) // regular get #define MEM_get(e,x) getDECL(e) { return I->mem_hist.new. x; } // delta get -#define HST_get(e,x) getDECL(e) { int n = I->mem_hist.new. x - I->mem_hist.old. x; \ - return ( n < 0 ? 0 : n ); } +#define HST_get(e,x) getDECL(e) { return ( I->mem_hist.new. x - I->mem_hist.old. x ); } getDECL(noop) { (void)I; return 0; } getDECL(extra) { (void)I; return 0; }