aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-09-03 16:02:13 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-09-03 16:02:13 +0100
commit11d411e3850a36c3185c79d5fa091868b7ef4a81 (patch)
tree87534cfa8997b5889d465a3ce3d1f2eea4983044
parentf67ac5a70a1121eea7d16fd9ce0eb684cfbb48fe (diff)
downloadrspamd-11d411e3850a36c3185c79d5fa091868b7ef4a81.tar.gz
rspamd-11d411e3850a36c3185c79d5fa091868b7ef4a81.zip
Allow to get memory pool for radix tree.
-rw-r--r--src/libutil/radix.c15
-rw-r--r--src/libutil/radix.h5
2 files changed, 17 insertions, 3 deletions
diff --git a/src/libutil/radix.c b/src/libutil/radix.c
index 26e4a98c8..a919691da 100644
--- a/src/libutil/radix.c
+++ b/src/libutil/radix.c
@@ -675,6 +675,15 @@ radix_get_size (radix_compressed_t *tree)
return 0;
}
-/*
- * vi:ts=4
- */
+
+
+rspamd_mempool_t *
+radix_get_pool (radix_compressed_t *tree)
+{
+
+ if (tree != NULL) {
+ return tree->pool;
+ }
+
+ return NULL;
+}
diff --git a/src/libutil/radix.h b/src/libutil/radix.h
index a7ea7f868..4200cf65e 100644
--- a/src/libutil/radix.h
+++ b/src/libutil/radix.h
@@ -104,4 +104,9 @@ gboolean radix_add_generic_iplist (const gchar *ip_list,
*/
gsize radix_get_size (radix_compressed_t *tree);
+/**
+ * Returns memory pool associated with the radix tree
+ */
+rspamd_mempool_t* radix_get_pool (radix_compressed_t *tree);
+
#endif