diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-04-21 04:08:01 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-04-21 04:08:01 +0400 |
commit | da9546194391e7d14ffe9b0c78f84892b012ff28 (patch) | |
tree | 573d8247533354e338ca4783dc4bdf28b078e531 /src/mem_pool.c | |
parent | d0dbd1aa3a95c5a1f354458033f6af2b8f01a4a5 (diff) | |
download | rspamd-da9546194391e7d14ffe9b0c78f84892b012ff28.tar.gz rspamd-da9546194391e7d14ffe9b0c78f84892b012ff28.zip |
* Add counter for oversized chunks: this parameter can improve performance, for example
if we have too many oversized chunks it is good decision to increase
chunk size.
Diffstat (limited to 'src/mem_pool.c')
-rw-r--r-- | src/mem_pool.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mem_pool.c b/src/mem_pool.c index 956a62422..66d9ace19 100644 --- a/src/mem_pool.c +++ b/src/mem_pool.c @@ -168,6 +168,7 @@ memory_pool_alloc (memory_pool_t *pool, memory_pool_ssize_t size) new = pool_chain_new (cur->len); } else { + mem_pool_stat->oversized_chunks ++; new = pool_chain_new (size + cur->len); } /* Attach new pool to chain */ @@ -239,6 +240,7 @@ memory_pool_alloc_shared (memory_pool_t *pool, memory_pool_ssize_t size) new = pool_chain_new_shared (cur->len); } else { + mem_pool_stat->oversized_chunks ++; new = pool_chain_new_shared (size + cur->len); } /* Attach new pool to chain */ @@ -402,6 +404,7 @@ memory_pool_stat (memory_pool_stat_t *st) st->chunks_allocated = mem_pool_stat->chunks_allocated; st->shared_chunks_allocated = mem_pool_stat->shared_chunks_allocated; st->chunks_freed = mem_pool_stat->chunks_freed; + st->oversized_chunks = mem_pool_stat->oversized_chunks; } #define FIXED_POOL_SIZE 4095 |