if (pool) {
POOL_MTX_LOCK ();
+ pool->used_memory += size;
+
if (always_malloc && pool_type != RSPAMD_MEMPOOL_SHARED) {
void *ptr;
}
if (cur == NULL || free < size) {
+ if (free < size) {
+ pool->wasted_memory += free;
+ }
+
/* Allocate new chain element */
if (pool->elt_len >= size + MIN_MEM_ALIGNMENT) {
pool->entry->elts[pool->entry->cur_elts].fragmentation += size;
GPtrArray *trash_stack;
GHashTable *variables; /**< private memory pool variables */
gsize elt_len; /**< size of an element */
+ gsize used_memory;
+ gsize wasted_memory;
struct rspamd_mempool_entry_point *entry;
struct rspamd_mempool_tag tag; /**< memory pool tag */
} rspamd_mempool_t;