From: Vsevolod Stakhov Date: Thu, 3 Sep 2015 15:02:13 +0000 (+0100) Subject: Allow to get memory pool for radix tree. X-Git-Tag: 1.0.0~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11d411e3850a36c3185c79d5fa091868b7ef4a81;p=thirdparty%2Frspamd.git Allow to get memory pool for radix tree. --- diff --git a/src/libutil/radix.c b/src/libutil/radix.c index 26e4a98c82..a919691da0 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 a7ea7f868a..4200cf65e2 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