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 | 100cc6fea7515f6c6706960678c7de6cdb438056 (patch) | |
tree | 07455a17b9de0227444751069ab0ca9276a82252 /pool.h | |
parent | 52b6524e05214d42b4da1562d353056907d3c1b0 (diff) | |
download | openttd-100cc6fea7515f6c6706960678c7de6cdb438056.tar.xz |
(svn r4471) - Pools: Add a facility for calling a custom function during pool block clean up.
Diffstat (limited to 'pool.h')
-rw-r--r-- | pool.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -8,6 +8,8 @@ typedef struct MemoryPool MemoryPool; /* The function that is called after a new block is added start_item is the first item of the new made block */ typedef void MemoryPoolNewBlock(uint start_item); +/* The function that is called before a block is cleaned up */ +typedef void MemoryPoolCleanBlock(uint start_item, uint end_item); /** * Stuff for dynamic vehicles. Use the wrappers to access the MemoryPool @@ -22,6 +24,8 @@ struct MemoryPool { /// Pointer to a function that is called after a new block is added MemoryPoolNewBlock *new_block_proc; + /// Pointer to a function that is called to clean a block + MemoryPoolCleanBlock *clean_block_proc; uint current_blocks; ///< How many blocks we have in our pool uint total_items; ///< How many items we now have in this pool |