(svn r4471) - Pools: Add a facility for calling a custom function during pool block clean up.

This commit is contained in:
peter1138
2006-04-18 18:48:50 +00:00
parent 24ef4ce560
commit ae7ec5cd0d
12 changed files with 20 additions and 12 deletions

6
pool.c
View File

@@ -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);