aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/mem_pool.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-12-23 19:08:05 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-12-23 19:08:05 +0000
commitaf417271a47e88d47cc3dc25f93f56d74864c3dd (patch)
tree49ce8f5dcb846a11434f0c773eae2844359b10e1 /src/libutil/mem_pool.h
parent580873ff0beb7222ae015da5060cfa8b1c8884c0 (diff)
downloadrspamd-af417271a47e88d47cc3dc25f93f56d74864c3dd.tar.gz
rspamd-af417271a47e88d47cc3dc25f93f56d74864c3dd.zip
[Project] Add rspamd_mempool_notify_alloc function
Diffstat (limited to 'src/libutil/mem_pool.h')
-rw-r--r--src/libutil/mem_pool.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libutil/mem_pool.h b/src/libutil/mem_pool.h
index 773be33d3..1554edbd2 100644
--- a/src/libutil/mem_pool.h
+++ b/src/libutil/mem_pool.h
@@ -155,6 +155,16 @@ RSPAMD_ATTR_ALLOC_SIZE(2) RSPAMD_ATTR_ALLOC_ALIGN(MIN_MEM_ALIGNMENT) RSPAMD_ATTR
rspamd_mempool_alloc_((pool), (size), G_STRLOC)
/**
+ * Notify external memory usage for memory pool
+ * @param pool
+ * @param size
+ * @param loc
+ */
+void rspamd_mempool_notify_alloc_ (rspamd_mempool_t *pool, gsize size, const gchar *loc);
+#define rspamd_mempool_notify_alloc(pool, size) \
+ rspamd_mempool_notify_alloc_((pool), (size), G_STRLOC)
+
+/**
* Get memory and set it to zero
* @param pool memory pool object
* @param size bytes to allocate