aboutsummaryrefslogtreecommitdiffstats
path: root/src/mem_pool.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-03-10 18:25:09 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-03-10 18:25:09 +0300
commiteda90216086cafa5c84f7a13f4d5bf72d4e225bd (patch)
tree84c75e0eda4dfa26209ab71d93165b19b6307283 /src/mem_pool.h
parentaa959154787b080cdfa5efe09e5c927381d095a2 (diff)
downloadrspamd-eda90216086cafa5c84f7a13f4d5bf72d4e225bd.tar.gz
rspamd-eda90216086cafa5c84f7a13f4d5bf72d4e225bd.zip
Fix race in surbl module.
Add more debugging to destructors in pools.
Diffstat (limited to 'src/mem_pool.h')
-rw-r--r--src/mem_pool.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mem_pool.h b/src/mem_pool.h
index 9cc381f7d..d25a4dc2f 100644
--- a/src/mem_pool.h
+++ b/src/mem_pool.h
@@ -62,6 +62,8 @@ struct _pool_chain_shared {
struct _pool_destructors {
pool_destruct_func func; /**< pointer to destructor */
void *data; /**< data to free */
+ const gchar *function; /**< function from which this destructor was added */
+ const gchar *loc; /**< line number */
struct _pool_destructors *prev; /**< chain link */
};
@@ -165,7 +167,11 @@ void memory_pool_unlock_shared (memory_pool_t *pool, void *pointer);
* @param func pointer to function-destructor
* @param data pointer to data that would be passed to destructor
*/
-void memory_pool_add_destructor (memory_pool_t *pool, pool_destruct_func func, void *data);
+void memory_pool_add_destructor_full (memory_pool_t *pool, pool_destruct_func func, void *data,
+ const gchar *function, const gchar *line);
+
+/* Macros for common usage */
+#define memory_pool_add_destructor(pool, func, data) memory_pool_add_destructor_full(pool, func, data, G_STRFUNC, G_STRLOC)
/**
* Replace destructor callback to pool for specified pointer