From 7c3ad2bf3d4c5cac82146b3359134137bc6d83ff Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Tue, 10 Sep 2019 09:43:04 -0400 Subject: Update the typeof(PROCINFO) hack to return memory highwater and active counts. --- node.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'node.c') diff --git a/node.c b/node.c index 5333e848..c99af12a 100644 --- a/node.c +++ b/node.c @@ -1041,14 +1041,16 @@ r_getblock(int id) { void *res; emalloc(res, void *, nextfree[id].size, "getblock"); - nextfree[id].cnt++; + nextfree[id].active++; + if (nextfree[id].highwater < nextfree[id].active) + nextfree[id].highwater = nextfree[id].active; return res; } void r_freeblock(void *p, int id) { - nextfree[id].cnt--; + nextfree[id].active--; free(p); } @@ -1081,7 +1083,7 @@ more_blocks(int id) np->freep = next; } nextfree[id].freep = freep->freep; - nextfree[id].cnt += BLOCKCHUNK; + nextfree[id].highwater += BLOCKCHUNK; return freep; } -- cgit v1.2.3