From f884bd2217992c92f20b1bab5dcdbc20de3de068 Mon Sep 17 00:00:00 2001 From: Dale Weiler Date: Sun, 2 Jun 2013 04:45:04 +0000 Subject: [PATCH] Track hashtables too --- util.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/util.c b/util.c index 351aba6..2151547 100644 --- a/util.c +++ b/util.c @@ -211,6 +211,7 @@ void util_st_put(size_table_t table, size_t key, size_t value) { static uint64_t strdups = 0; static uint64_t vectors = 0; static uint64_t vector_sizes = 0; +static uint64_t hashtables = 0; static size_table_t vector_usage = NULL; void util_meminfo() { @@ -254,12 +255,14 @@ void util_meminfo() { size_t e=1; con_out("Additional Statistics:\n\ - Total vectors allocated: %u\n\ - Total string duplicates: %u\n\ - Total unique vector sizes: %u\n", - (unsigned)vectors, - (unsigned)strdups, - (unsigned)vector_sizes + Total vectors allocated: %llu\n\ + Total string duplicates: %llu\n\ + Total hashtables allocated: %llu\n\ + Total unique vector sizes: %llu\n", + vectors, + strdups, + hashtables, + vector_sizes ); for (; i < ST_SIZE; i++) { @@ -627,6 +630,7 @@ hash_table_t *util_htnew(size_t size) { hashtable->size = size; memset(hashtable->table, 0, sizeof(hash_node_t*) * size); + hashtables++; return hashtable; }