diff options
author | peter1138 <peter1138@openttd.org> | 2006-04-18 18:48:50 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2006-04-18 18:48:50 +0000 |
commit | ae7ec5cd0d9eb0a137c8a3cf9e7ca99679768a87 (patch) | |
tree | 07455a17b9de0227444751069ab0ca9276a82252 /pool.c | |
parent | 24ef4ce560cc3e0b4e45fe15fae839ce8071bec9 (diff) | |
download | openttd-ae7ec5cd0d9eb0a137c8a3cf9e7ca99679768a87.tar.xz |
(svn r4471) - Pools: Add a facility for calling a custom function during pool block clean up.
Diffstat (limited to 'pool.c')
-rw-r--r-- | pool.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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); |