aboutsummaryrefslogtreecommitdiffstats
path: root/node.c
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2019-09-01 11:48:01 -0400
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2019-09-01 11:48:01 -0400
commit5c41849e0e78e45db0dc4421f1779ef7bec726da (patch)
treeab2ac8627c02a10f763650d30d58aac4b4c372ab /node.c
parent8cc45af919dc56011dbf4c8965b9c1e4784e56d7 (diff)
downloadegawk-5c41849e0e78e45db0dc4421f1779ef7bec726da.tar.gz
egawk-5c41849e0e78e45db0dc4421f1779ef7bec726da.tar.bz2
egawk-5c41849e0e78e45db0dc4421f1779ef7bec726da.zip
Hack the typeof function to return memory count info when the 2nd arg is PROCINFO.
Diffstat (limited to 'node.c')
-rw-r--r--node.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/node.c b/node.c
index eacd17b3..5333e848 100644
--- a/node.c
+++ b/node.c
@@ -1026,11 +1026,11 @@ void init_btowc_cache()
#define BLOCKCHUNK 100
struct block_header nextfree[BLOCK_MAX] = {
- { NULL, sizeof(NODE) },
- { NULL, sizeof(BUCKET) },
+ { NULL, sizeof(NODE), "node" },
+ { NULL, sizeof(BUCKET), "bucket" },
#ifdef HAVE_MPFR
- { NULL, sizeof(mpfr_t) },
- { NULL, sizeof(mpz_t) },
+ { NULL, sizeof(mpfr_t), "mpfr" },
+ { NULL, sizeof(mpz_t), "mpz" },
#endif
};
@@ -1081,6 +1081,7 @@ more_blocks(int id)
np->freep = next;
}
nextfree[id].freep = freep->freep;
+ nextfree[id].cnt += BLOCKCHUNK;
return freep;
}