aboutsummaryrefslogtreecommitdiffstats
path: root/src/mem_pool.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-06-08 18:55:35 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-06-08 18:55:35 +0400
commitb1334526d1c333767d2e4fed38067bcc535e3f59 (patch)
treeefb44261229c9c091c8cf55a17749cb23cc5c2be /src/mem_pool.c
parente116632d552920e6bbcc8d9fbccf76689ef7f16b (diff)
downloadrspamd-b1334526d1c333767d2e4fed38067bcc535e3f59.tar.gz
rspamd-b1334526d1c333767d2e4fed38067bcc535e3f59.zip
* Add more logic for dynamic rules
* Add documentation for dynamic rules * Add ability to make negations in networks in dynamic rules
Diffstat (limited to 'src/mem_pool.c')
-rw-r--r--src/mem_pool.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mem_pool.c b/src/mem_pool.c
index 11f74f2f3..363116ce5 100644
--- a/src/mem_pool.c
+++ b/src/mem_pool.c
@@ -429,6 +429,23 @@ memory_pool_add_destructor (memory_pool_t * pool, pool_destruct_func func, void
}
void
+memory_pool_replace_destructor (memory_pool_t * pool, pool_destruct_func func, void *old_data, void *new_data)
+{
+ struct _pool_destructors *tmp;
+
+ tmp = pool->destructors;
+ while (tmp) {
+ if (tmp->func == func && tmp->data == old_data) {
+ tmp->func = func;
+ tmp->data = new_data;
+ break;
+ }
+ tmp = tmp->prev;
+ }
+
+}
+
+void
memory_pool_delete (memory_pool_t * pool)
{
struct _pool_chain *cur = pool->first_pool, *tmp;