diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2019-09-10 09:43:04 -0400 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2019-09-10 09:43:04 -0400 |
commit | 7c3ad2bf3d4c5cac82146b3359134137bc6d83ff (patch) | |
tree | 7831287ee49e8e9ee12b22887c409fd3620fc391 /node.c | |
parent | abc7fc68f8ce227db5a1ce881a8f065577c764dd (diff) | |
download | egawk-7c3ad2bf3d4c5cac82146b3359134137bc6d83ff.tar.gz egawk-7c3ad2bf3d4c5cac82146b3359134137bc6d83ff.tar.bz2 egawk-7c3ad2bf3d4c5cac82146b3359134137bc6d83ff.zip |
Update the typeof(PROCINFO) hack to return memory highwater and active counts.
Diffstat (limited to 'node.c')
-rw-r--r-- | node.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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; } |