From ae7ec5cd0d9eb0a137c8a3cf9e7ca99679768a87 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Tue, 18 Apr 2006 18:48:50 +0000 Subject: (svn r4471) - Pools: Add a facility for calling a custom function during pool block clean up. --- pool.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pool.c') diff --git a/pool.c b/pool.c index 9b340e3f2..828aa87d9 100644 --- a/pool.c +++ b/pool.c @@ -16,8 +16,12 @@ void CleanPool(MemoryPool *pool) DEBUG(misc, 4)("[Pool] (%s) Cleaning pool..", pool->name); /* Free all blocks */ - for (i = 0; i < pool->current_blocks; i++) + for (i = 0; i < pool->current_blocks; i++) { + if (pool->clean_block_proc != NULL) { + pool->clean_block_proc(i * (1 << pool->block_size_bits), (i + 1) * (1 << pool->block_size_bits) - 1); + } free(pool->blocks[i]); + } /* Free the block itself */ free(pool->blocks); -- cgit v1.2.3-54-g00ecf