aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/controller.c2
-rw-r--r--src/libserver/buffer.c2
-rw-r--r--src/libserver/cfg_utils.c3
-rw-r--r--src/libserver/symbols_cache.c2
-rw-r--r--src/libserver/task.c2
-rw-r--r--src/libstat/backends/mmaped_file.c2
-rw-r--r--src/libutil/logger.c2
-rw-r--r--src/libutil/map.c4
-rw-r--r--src/libutil/mem_pool.c22
-rw-r--r--src/libutil/mem_pool.h11
-rw-r--r--src/libutil/radix.c2
-rw-r--r--src/lua/lua_mempool.c3
-rw-r--r--src/lua/lua_regexp.c2
-rw-r--r--src/lua/lua_util.c2
-rw-r--r--src/main.c3
-rw-r--r--src/plugins/chartable.c5
-rw-r--r--src/plugins/dkim_check.c6
-rw-r--r--src/plugins/fuzzy_check.c6
-rw-r--r--src/plugins/regexp.c6
-rw-r--r--src/plugins/spf.c6
-rw-r--r--src/plugins/surbl.c6
-rw-r--r--src/smtp_proxy.c4
-rw-r--r--test/rspamd_dns_test.c4
-rw-r--r--test/rspamd_http_test.c2
-rw-r--r--test/rspamd_mem_pool_test.c2
-rw-r--r--test/rspamd_test_suite.c4
-rw-r--r--test/rspamd_upstream_test.c2
27 files changed, 66 insertions, 51 deletions
diff --git a/src/controller.c b/src/controller.c
index 2c9cfae3e..b92f1e5ff 100644
--- a/src/controller.c
+++ b/src/controller.c
@@ -1811,7 +1811,7 @@ rspamd_controller_accept_socket (gint fd, short what, void *arg)
}
nsession = g_slice_alloc0 (sizeof (struct rspamd_controller_session));
- nsession->pool = rspamd_mempool_new (rspamd_mempool_suggest_size ());
+ nsession->pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
nsession->ctx = ctx;
nsession->from_addr = addr;
diff --git a/src/libserver/buffer.c b/src/libserver/buffer.c
index f67eacbe0..7c0311e5b 100644
--- a/src/libserver/buffer.c
+++ b/src/libserver/buffer.c
@@ -603,7 +603,7 @@ rspamd_create_dispatcher (struct event_base *base,
new = g_slice_alloc0 (sizeof (rspamd_io_dispatcher_t));
- new->pool = rspamd_mempool_new (rspamd_mempool_suggest_size ());
+ new->pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
if (tv != NULL) {
new->tv = rspamd_mempool_alloc (new->pool, sizeof (struct timeval));
memcpy (new->tv, tv, sizeof (struct timeval));
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index 7246ab4a1..630ee1344 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -942,8 +942,7 @@ rspamd_init_filters (struct rspamd_config *cfg, bool reconfig)
void
rspamd_init_cfg (struct rspamd_config *cfg, gboolean init_lua)
{
- cfg->cfg_pool = rspamd_mempool_new (
- rspamd_mempool_suggest_size ());
+ cfg->cfg_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
rspamd_config_defaults (cfg);
if (init_lua) {
diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c
index 30b146a4e..7f58922f3 100644
--- a/src/libserver/symbols_cache.c
+++ b/src/libserver/symbols_cache.c
@@ -594,7 +594,7 @@ rspamd_symbols_cache_new (void)
cache = g_slice_alloc0 (sizeof (struct symbols_cache));
cache->static_pool =
- rspamd_mempool_new (rspamd_mempool_suggest_size ());
+ rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
cache->items_by_symbol = g_hash_table_new (rspamd_str_hash,
rspamd_str_equal);
cache->items_by_order = g_ptr_array_new ();
diff --git a/src/libserver/task.c b/src/libserver/task.c
index 3740e3323..96ad7f5c4 100644
--- a/src/libserver/task.c
+++ b/src/libserver/task.c
@@ -59,7 +59,7 @@ rspamd_task_new (struct rspamd_worker *worker)
new_task->time_real = rspamd_get_ticks ();
new_task->time_virtual = rspamd_get_virtual_ticks ();
- new_task->task_pool = rspamd_mempool_new (rspamd_mempool_suggest_size ());
+ new_task->task_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
new_task->results = g_hash_table_new (rspamd_str_hash, rspamd_str_equal);
rspamd_mempool_add_destructor (new_task->task_pool,
diff --git a/src/libstat/backends/mmaped_file.c b/src/libstat/backends/mmaped_file.c
index e0cb528e5..e8de381ad 100644
--- a/src/libstat/backends/mmaped_file.c
+++ b/src/libstat/backends/mmaped_file.c
@@ -848,7 +848,7 @@ rspamd_mmaped_file_init (struct rspamd_stat_ctx *ctx, struct rspamd_config *cfg)
gsize size;
new = rspamd_mempool_alloc0 (cfg->cfg_pool, sizeof (rspamd_mmaped_file_ctx));
- new->pool = rspamd_mempool_new (rspamd_mempool_suggest_size ());
+ new->pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
new->lock = rspamd_mempool_get_mutex (new->pool);
new->mlock_ok = cfg->mlock_statfile_pool;
new->files = g_hash_table_new (g_direct_hash, g_direct_equal);
diff --git a/src/libutil/logger.c b/src/libutil/logger.c
index 1cf348489..87a8781e8 100644
--- a/src/libutil/logger.c
+++ b/src/libutil/logger.c
@@ -294,7 +294,7 @@ rspamd_set_logger (struct rspamd_config *cfg,
rspamd->logger = g_malloc (sizeof (rspamd_logger_t));
memset (rspamd->logger, 0, sizeof (rspamd_logger_t));
/* Small pool for interlocking */
- rspamd->logger->pool = rspamd_mempool_new (512);
+ rspamd->logger->pool = rspamd_mempool_new (512, NULL);
rspamd->logger->mtx = rspamd_mempool_get_mutex (rspamd->logger->pool);
}
diff --git a/src/libutil/map.c b/src/libutil/map.c
index 72f3a78b3..65ebb076e 100644
--- a/src/libutil/map.c
+++ b/src/libutil/map.c
@@ -471,7 +471,7 @@ rspamd_map_add (struct rspamd_config *cfg,
}
/* Constant pool */
if (cfg->map_pool == NULL) {
- cfg->map_pool = rspamd_mempool_new (rspamd_mempool_suggest_size ());
+ cfg->map_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
}
new_map = rspamd_mempool_alloc0 (cfg->map_pool, sizeof (struct rspamd_map));
new_map->read_callback = read_callback;
@@ -588,7 +588,7 @@ rspamd_map_add (struct rspamd_config *cfg,
new_map->map_data = hdata;
}
/* Temp pool */
- new_map->pool = rspamd_mempool_new (rspamd_mempool_suggest_size ());
+ new_map->pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
cfg->maps = g_list_prepend (cfg->maps, new_map);
diff --git a/src/libutil/mem_pool.c b/src/libutil/mem_pool.c
index 81487e49c..084b4400b 100644
--- a/src/libutil/mem_pool.c
+++ b/src/libutil/mem_pool.c
@@ -29,6 +29,7 @@
#include "util.h"
#include "main.h"
#include "utlist.h"
+#include "ottery.h"
/* Sleep time for spin lock in nanoseconds */
#define MUTEX_SLEEP_TIME 10000000L
@@ -152,10 +153,13 @@ pool_chain_new_shared (gsize size)
* @return new memory pool object
*/
rspamd_mempool_t *
-rspamd_mempool_new (gsize size)
+rspamd_mempool_new (gsize size, const gchar *tag)
{
rspamd_mempool_t *new;
gpointer map;
+ unsigned char uidbuf[10];
+ const gchar hexdigits[] = "0123456789abcdef";
+ unsigned i;
g_return_val_if_fail (size > 0, NULL);
/* Allocate statistic structure if it is not allocated before */
@@ -215,6 +219,22 @@ rspamd_mempool_new (gsize size)
/* Set it upon first call of set variable */
new->variables = NULL;
new->elt_len = size;
+
+ if (tag) {
+ rspamd_strlcpy (new->tag.tagname, tag, sizeof (new->tag.tagname));
+ }
+ else {
+ new->tag.tagname[0] = '\0';
+ }
+
+ /* Generate new uid */
+ ottery_rand_bytes (uidbuf, sizeof (uidbuf));
+ for (i = 0; i < G_N_ELEMENTS (uidbuf); i ++) {
+ new->tag.uid[i * 2] = hexdigits[(uidbuf[i] >> 4) & 0xf];
+ new->tag.uid[i * 2 + 2] = hexdigits[uidbuf[i] & 0xf];
+ }
+ new->tag.uid[19] = '\0';
+
mem_pool_stat->pools_allocated++;
return new;
diff --git a/src/libutil/mem_pool.h b/src/libutil/mem_pool.h
index 1befd8445..42df30148 100644
--- a/src/libutil/mem_pool.h
+++ b/src/libutil/mem_pool.h
@@ -82,6 +82,14 @@ struct _pool_destructors {
};
/**
+ * Tag to use for logging purposes
+ */
+struct rspamd_mempool_tag {
+ gchar tagname[20]; /**< readable name */
+ gchar uid[20]; /**< unique id */
+};
+
+/**
* Memory pool type
*/
struct rspamd_mutex_s;
@@ -92,6 +100,7 @@ typedef struct memory_pool_s {
struct _pool_destructors *destructors; /**< destructors chain */
GHashTable *variables; /**< private memory pool variables */
gsize elt_len; /**< size of an element */
+ struct rspamd_mempool_tag tag; /**< memory pool tag */
} rspamd_mempool_t;
/**
@@ -114,7 +123,7 @@ typedef struct memory_pool_stat_s {
* @param size size of pool's page
* @return new memory pool object
*/
-rspamd_mempool_t * rspamd_mempool_new (gsize size);
+rspamd_mempool_t *rspamd_mempool_new (gsize size, const gchar *tag);
/**
* Get memory from pool
diff --git a/src/libutil/radix.c b/src/libutil/radix.c
index 39fc39445..0d51d77f7 100644
--- a/src/libutil/radix.c
+++ b/src/libutil/radix.c
@@ -527,7 +527,7 @@ radix_create_compressed (void)
return NULL;
}
- tree->pool = rspamd_mempool_new (rspamd_mempool_suggest_size ());
+ tree->pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
tree->size = 0;
tree->root = NULL;
diff --git a/src/lua/lua_mempool.c b/src/lua/lua_mempool.c
index 8f2ad2f42..1a7b22742 100644
--- a/src/lua/lua_mempool.c
+++ b/src/lua/lua_mempool.c
@@ -140,8 +140,7 @@ rspamd_lua_check_mempool (lua_State * L, gint pos)
static int
lua_mempool_create (lua_State *L)
{
- struct memory_pool_s *mempool = rspamd_mempool_new (
- rspamd_mempool_suggest_size ()), **pmempool;
+ struct memory_pool_s *mempool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL), **pmempool;
if (mempool) {
pmempool = lua_newuserdata (L, sizeof (struct memory_pool_s *));
diff --git a/src/lua/lua_regexp.c b/src/lua/lua_regexp.c
index 75e54bab5..594b42bbe 100644
--- a/src/lua/lua_regexp.c
+++ b/src/lua/lua_regexp.c
@@ -665,5 +665,5 @@ luaopen_regexp (lua_State * L)
luaL_register (L, NULL, regexplib_m);
rspamd_lua_add_preload (L, "rspamd_regexp", lua_load_regexp);
- regexp_static_pool = rspamd_mempool_new (rspamd_mempool_suggest_size ());
+ regexp_static_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
}
diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c
index 5b57c9158..260ec7b30 100644
--- a/src/lua/lua_util.c
+++ b/src/lua/lua_util.c
@@ -505,7 +505,7 @@ lua_util_parse_html (lua_State *L)
}
if (start != NULL) {
- pool = rspamd_mempool_new (rspamd_mempool_suggest_size ());
+ pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
hc = rspamd_mempool_alloc0 (pool, sizeof (*hc));
in = g_byte_array_sized_new (len);
g_byte_array_append (in, start, len);
diff --git a/src/main.c b/src/main.c
index fb2a362df..17ee7334d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1029,8 +1029,7 @@ do_encrypt_password (void)
static void
rspamd_init_main (struct rspamd_main *rspamd)
{
- rspamd->server_pool = rspamd_mempool_new (
- rspamd_mempool_suggest_size ());
+ rspamd->server_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
rspamd_main->stat = rspamd_mempool_alloc0_shared (rspamd_main->server_pool,
sizeof (struct rspamd_stat));
/* Create rolling history */
diff --git a/src/plugins/chartable.c b/src/plugins/chartable.c
index 1cb1c7ed7..2cd12b68d 100644
--- a/src/plugins/chartable.c
+++ b/src/plugins/chartable.c
@@ -67,8 +67,7 @@ chartable_module_init (struct rspamd_config *cfg, struct module_ctx **ctx)
{
chartable_module_ctx = g_malloc (sizeof (struct chartable_ctx));
- chartable_module_ctx->chartable_pool = rspamd_mempool_new (
- rspamd_mempool_suggest_size ());
+ chartable_module_ctx->chartable_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
*ctx = (struct module_ctx *)chartable_module_ctx;
@@ -119,7 +118,7 @@ gint
chartable_module_reconfig (struct rspamd_config *cfg)
{
rspamd_mempool_delete (chartable_module_ctx->chartable_pool);
- chartable_module_ctx->chartable_pool = rspamd_mempool_new (1024);
+ chartable_module_ctx->chartable_pool = rspamd_mempool_new (1024, NULL);
return chartable_module_config (cfg);
}
diff --git a/src/plugins/dkim_check.c b/src/plugins/dkim_check.c
index 50644cb28..2fa5610f9 100644
--- a/src/plugins/dkim_check.c
+++ b/src/plugins/dkim_check.c
@@ -100,8 +100,7 @@ dkim_module_init (struct rspamd_config *cfg, struct module_ctx **ctx)
{
dkim_module_ctx = g_malloc0 (sizeof (struct dkim_ctx));
- dkim_module_ctx->dkim_pool = rspamd_mempool_new (
- rspamd_mempool_suggest_size ());
+ dkim_module_ctx->dkim_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
*ctx = (struct module_ctx *)dkim_module_ctx;
@@ -278,8 +277,7 @@ dkim_module_reconfig (struct rspamd_config *cfg)
memset (dkim_module_ctx, 0, sizeof (*dkim_module_ctx));
dkim_module_ctx->ctx = saved_ctx;
- dkim_module_ctx->dkim_pool = rspamd_mempool_new (
- rspamd_mempool_suggest_size ());
+ dkim_module_ctx->dkim_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
return dkim_module_config (cfg);
}
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c
index 7d240fcec..4e969bfd9 100644
--- a/src/plugins/fuzzy_check.c
+++ b/src/plugins/fuzzy_check.c
@@ -408,8 +408,7 @@ fuzzy_check_module_init (struct rspamd_config *cfg, struct module_ctx **ctx)
{
fuzzy_module_ctx = g_malloc0 (sizeof (struct fuzzy_ctx));
- fuzzy_module_ctx->fuzzy_pool = rspamd_mempool_new (
- rspamd_mempool_suggest_size ());
+ fuzzy_module_ctx->fuzzy_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
fuzzy_module_ctx->cfg = cfg;
*ctx = (struct module_ctx *)fuzzy_module_ctx;
@@ -519,8 +518,7 @@ fuzzy_check_module_reconfig (struct rspamd_config *cfg)
rspamd_mempool_delete (fuzzy_module_ctx->fuzzy_pool);
memset (fuzzy_module_ctx, 0, sizeof (*fuzzy_module_ctx));
fuzzy_module_ctx->ctx = saved_ctx;
- fuzzy_module_ctx->fuzzy_pool = rspamd_mempool_new (
- rspamd_mempool_suggest_size ());
+ fuzzy_module_ctx->fuzzy_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
fuzzy_module_ctx->cfg = cfg;
return fuzzy_check_module_config (cfg);
diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c
index 489a64364..c122004ae 100644
--- a/src/plugins/regexp.c
+++ b/src/plugins/regexp.c
@@ -98,8 +98,7 @@ regexp_module_init (struct rspamd_config *cfg, struct module_ctx **ctx)
{
regexp_module_ctx = g_malloc (sizeof (struct regexp_ctx));
- regexp_module_ctx->regexp_pool = rspamd_mempool_new (
- rspamd_mempool_suggest_size ());
+ regexp_module_ctx->regexp_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
*ctx = (struct module_ctx *)regexp_module_ctx;
@@ -184,8 +183,7 @@ regexp_module_reconfig (struct rspamd_config *cfg)
rspamd_mempool_delete (regexp_module_ctx->regexp_pool);
memset (regexp_module_ctx, 0, sizeof (*regexp_module_ctx));
regexp_module_ctx->ctx = saved_ctx;
- regexp_module_ctx->regexp_pool = rspamd_mempool_new (
- rspamd_mempool_suggest_size ());
+ regexp_module_ctx->regexp_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
return regexp_module_config (cfg);
}
diff --git a/src/plugins/spf.c b/src/plugins/spf.c
index 51673bcba..eb50ab2b9 100644
--- a/src/plugins/spf.c
+++ b/src/plugins/spf.c
@@ -92,8 +92,7 @@ spf_module_init (struct rspamd_config *cfg, struct module_ctx **ctx)
{
spf_module_ctx = g_malloc (sizeof (struct spf_ctx));
- spf_module_ctx->spf_pool = rspamd_mempool_new (
- rspamd_mempool_suggest_size ());
+ spf_module_ctx->spf_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
*ctx = (struct module_ctx *)spf_module_ctx;
@@ -208,8 +207,7 @@ spf_module_reconfig (struct rspamd_config *cfg)
radix_destroy_compressed (spf_module_ctx->whitelist_ip);
memset (spf_module_ctx, 0, sizeof (*spf_module_ctx));
spf_module_ctx->ctx = saved_ctx;
- spf_module_ctx->spf_pool = rspamd_mempool_new (
- rspamd_mempool_suggest_size ());
+ spf_module_ctx->spf_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
return spf_module_config (cfg);
}
diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c
index 5a4b0a86d..062fb8c0f 100644
--- a/src/plugins/surbl.c
+++ b/src/plugins/surbl.c
@@ -276,8 +276,7 @@ surbl_module_init (struct rspamd_config *cfg, struct module_ctx **ctx)
surbl_module_ctx->use_redirector = 0;
surbl_module_ctx->suffixes = NULL;
- surbl_module_ctx->surbl_pool = rspamd_mempool_new (
- rspamd_mempool_suggest_size ());
+ surbl_module_ctx->surbl_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
surbl_module_ctx->tld2_file = NULL;
surbl_module_ctx->whitelist_file = NULL;
@@ -622,8 +621,7 @@ surbl_module_reconfig (struct rspamd_config *cfg)
/* Reinit module */
surbl_module_ctx->use_redirector = 0;
surbl_module_ctx->suffixes = NULL;
- surbl_module_ctx->surbl_pool = rspamd_mempool_new (
- rspamd_mempool_suggest_size ());
+ surbl_module_ctx->surbl_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
surbl_module_ctx->tld2_file = NULL;
surbl_module_ctx->whitelist_file = NULL;
diff --git a/src/smtp_proxy.c b/src/smtp_proxy.c
index 62d6ff6b7..0e9c32eb6 100644
--- a/src/smtp_proxy.c
+++ b/src/smtp_proxy.c
@@ -928,7 +928,7 @@ accept_socket (gint fd, short what, void *arg)
ctx = worker->ctx;
session = g_slice_alloc0 (sizeof (struct smtp_proxy_session));
- session->pool = rspamd_mempool_new (rspamd_mempool_suggest_size ());
+ session->pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
session->sock = nfd;
@@ -979,7 +979,7 @@ init_smtp_proxy (struct rspamd_config *cfg)
type = g_quark_try_string ("smtp_proxy");
ctx = g_malloc0 (sizeof (struct smtp_worker_ctx));
- ctx->pool = rspamd_mempool_new (rspamd_mempool_suggest_size ());
+ ctx->pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
/* Set default values */
ctx->smtp_timeout_raw = 300000;
diff --git a/test/rspamd_dns_test.c b/test/rspamd_dns_test.c
index dd2447d9c..31efdc827 100644
--- a/test/rspamd_dns_test.c
+++ b/test/rspamd_dns_test.c
@@ -74,11 +74,11 @@ rspamd_dns_test_func ()
cfg = (struct rspamd_config *)g_malloc (sizeof (struct rspamd_config));
bzero (cfg, sizeof (struct rspamd_config));
- cfg->cfg_pool = rspamd_mempool_new (rspamd_mempool_suggest_size ());
+ cfg->cfg_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
cfg->dns_retransmits = 2;
cfg->dns_timeout = 0.5;
- pool = rspamd_mempool_new (rspamd_mempool_suggest_size ());
+ pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
s = rspamd_session_create (pool, session_fin, NULL, NULL, NULL);
diff --git a/test/rspamd_http_test.c b/test/rspamd_http_test.c
index 324ad8e44..ee6c49b23 100644
--- a/test/rspamd_http_test.c
+++ b/test/rspamd_http_test.c
@@ -203,7 +203,7 @@ void
rspamd_http_test_func (void)
{
struct event_base *ev_base = event_init ();
- rspamd_mempool_t *pool = rspamd_mempool_new (rspamd_mempool_suggest_size ());
+ rspamd_mempool_t *pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
gpointer serv_key, client_key, peer_key;
struct rspamd_keypair_cache *c;
rspamd_mempool_mutex_t *mtx;
diff --git a/test/rspamd_mem_pool_test.c b/test/rspamd_mem_pool_test.c
index ba9a87aeb..fe5ba56b8 100644
--- a/test/rspamd_mem_pool_test.c
+++ b/test/rspamd_mem_pool_test.c
@@ -14,7 +14,7 @@ rspamd_mem_pool_test_func ()
pid_t pid;
int ret;
- pool = rspamd_mempool_new (sizeof (TEST_BUF));
+ pool = rspamd_mempool_new (sizeof (TEST_BUF), NULL);
tmp = rspamd_mempool_alloc (pool, sizeof (TEST_BUF));
tmp2 = rspamd_mempool_alloc (pool, sizeof (TEST_BUF) * 2);
tmp3 = rspamd_mempool_alloc_shared (pool, sizeof (TEST_BUF));
diff --git a/test/rspamd_test_suite.c b/test/rspamd_test_suite.c
index c1a2e27f5..8e092fd84 100644
--- a/test/rspamd_test_suite.c
+++ b/test/rspamd_test_suite.c
@@ -17,12 +17,12 @@ main (int argc, char **argv)
rspamd_main = (struct rspamd_main *)g_malloc (sizeof (struct rspamd_main));
memset (rspamd_main, 0, sizeof (struct rspamd_main));
- rspamd_main->server_pool = rspamd_mempool_new (rspamd_mempool_suggest_size ());
+ rspamd_main->server_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
rspamd_main->cfg = (struct rspamd_config *)g_malloc (sizeof (struct rspamd_config));
cfg = rspamd_main->cfg;
memset (cfg, 0, sizeof (struct rspamd_config));
rspamd_init_cfg (cfg, FALSE);
- cfg->cfg_pool = rspamd_mempool_new (rspamd_mempool_suggest_size ());
+ cfg->cfg_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
cfg->log_type = RSPAMD_LOG_CONSOLE;
cfg->log_level = G_LOG_LEVEL_INFO;
diff --git a/test/rspamd_upstream_test.c b/test/rspamd_upstream_test.c
index c6738b0ff..28c4bb757 100644
--- a/test/rspamd_upstream_test.c
+++ b/test/rspamd_upstream_test.c
@@ -76,7 +76,7 @@ rspamd_upstream_test_func (void)
cfg = (struct rspamd_config *)g_malloc (sizeof (struct rspamd_config));
bzero (cfg, sizeof (struct rspamd_config));
- cfg->cfg_pool = rspamd_mempool_new (rspamd_mempool_suggest_size ());
+ cfg->cfg_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL);
cfg->dns_retransmits = 2;
cfg->dns_timeout = 0.5;
cfg->upstream_max_errors = 1;