aboutsummaryrefslogtreecommitdiffstats
path: root/src/mem_pool.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-03-26 18:29:45 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-03-26 18:29:45 +0300
commit251d13cc56cdf625bafac9db008d85abe0fa893c (patch)
tree5b77b7055bf9e7da9a09d762e84cfaabed58131f /src/mem_pool.c
parentbd1213bba483c40213c7b24c7ded1cbf0c8cd5b1 (diff)
downloadrspamd-251d13cc56cdf625bafac9db008d85abe0fa893c.tar.gz
rspamd-251d13cc56cdf625bafac9db008d85abe0fa893c.zip
* Add statictics for all allocated pools
Diffstat (limited to 'src/mem_pool.c')
-rw-r--r--src/mem_pool.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mem_pool.c b/src/mem_pool.c
index 84ebe9a79..ab96483f0 100644
--- a/src/mem_pool.c
+++ b/src/mem_pool.c
@@ -142,6 +142,8 @@ memory_pool_new (memory_pool_ssize_t size)
new->first_pool = new->cur_pool;
new->destructors = NULL;
+ mem_pool_stat->pools_allocated ++;
+
return new;
}
@@ -387,12 +389,16 @@ memory_pool_delete (memory_pool_t *pool)
STAT_UNLOCK ();
}
+ mem_pool_stat->pools_freed ++;
g_free (pool);
}
void
memory_pool_stat (memory_pool_stat_t *st)
{
+ st->pools_allocated = mem_pool_stat->pools_allocated;
+ st->pools_freed = mem_pool_stat->pools_freed;
+ st->shared_chunks_allocated = mem_pool_stat->shared_chunks_allocated;
st->bytes_allocated = mem_pool_stat->bytes_allocated;
st->chunks_allocated = mem_pool_stat->chunks_allocated;
st->shared_chunks_allocated = mem_pool_stat->shared_chunks_allocated;