src/oldpool.h
author rubidium
Wed, 01 Aug 2007 22:10:54 +0000
changeset 7375 961ab798c4b6
parent 6351 8d0b6cce8d6d
child 7376 066596e64cd5
permissions -rw-r--r--
(svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 1259
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 1259
diff changeset
     2
6351
8d0b6cce8d6d (svn r9390) -Documentation : correct Doxygen of comments and @file inclusion. This time, brought to you by the letter O
belugas
parents: 6248
diff changeset
     3
/** @file oldpool.h */
8d0b6cce8d6d (svn r9390) -Documentation : correct Doxygen of comments and @file inclusion. This time, brought to you by the letter O
belugas
parents: 6248
diff changeset
     4
5224
df36f84cbb6c (svn r7341) - Codechange: Also rename the POOL_H define to OLDPOOL_H (forgotten in r7331).
matthijs
parents: 5216
diff changeset
     5
#ifndef OLDPOOL_H
df36f84cbb6c (svn r7341) - Codechange: Also rename the POOL_H define to OLDPOOL_H (forgotten in r7331).
matthijs
parents: 5216
diff changeset
     6
#define OLDPOOL_H
1259
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
     7
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
     8
/* The function that is called after a new block is added
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
     9
     start_item is the first item of the new made block */
5216
8bd14ee39af2 (svn r7331) - Codechange: Rename all memory pool macro's and types to "old pool", so the new pool implementation can be committed alongside it.
matthijs
parents: 4986
diff changeset
    10
typedef void OldMemoryPoolNewBlock(uint start_item);
3585
43461f26b729 (svn r4471) - Pools: Add a facility for calling a custom function during pool block clean up.
peter1138
parents: 3173
diff changeset
    11
/* The function that is called before a block is cleaned up */
5216
8bd14ee39af2 (svn r7331) - Codechange: Rename all memory pool macro's and types to "old pool", so the new pool implementation can be committed alongside it.
matthijs
parents: 4986
diff changeset
    12
typedef void OldMemoryPoolCleanBlock(uint start_item, uint end_item);
1259
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    13
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    14
/**
5216
8bd14ee39af2 (svn r7331) - Codechange: Rename all memory pool macro's and types to "old pool", so the new pool implementation can be committed alongside it.
matthijs
parents: 4986
diff changeset
    15
 * Stuff for dynamic vehicles. Use the wrappers to access the OldMemoryPool
1259
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    16
 *  please try to avoid manual calls!
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    17
 */
7375
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    18
struct OldMemoryPoolBase {
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    19
	void CleanPool();
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    20
	bool AddBlockToPool();
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    21
	bool AddBlockIfNeeded(uint index);
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    22
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    23
protected:
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    24
	OldMemoryPoolBase(const char *name, uint max_blocks, uint block_size_bits, uint item_size,
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    25
				OldMemoryPoolNewBlock *new_block_proc, OldMemoryPoolCleanBlock *clean_block_proc) :
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    26
		name(name), max_blocks(max_blocks), block_size_bits(block_size_bits), item_size(item_size),
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    27
		new_block_proc(new_block_proc), clean_block_proc(clean_block_proc), current_blocks(0),
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    28
		total_items(0), blocks(NULL) {}
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    29
5587
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    30
	const char* name;     ///< Name of the pool (just for debugging)
1259
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    31
5587
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    32
	uint max_blocks;      ///< The max amount of blocks this pool can have
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    33
	uint block_size_bits; ///< The size of each block in bits
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    34
	uint item_size;       ///< How many bytes one block is
1259
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    35
3173
f56ca618721b (svn r3805) - [FS#62] Fix doxygen comments to refer to the correct parameter. (sulai)
peter1138
parents: 2436
diff changeset
    36
	/// Pointer to a function that is called after a new block is added
5216
8bd14ee39af2 (svn r7331) - Codechange: Rename all memory pool macro's and types to "old pool", so the new pool implementation can be committed alongside it.
matthijs
parents: 4986
diff changeset
    37
	OldMemoryPoolNewBlock *new_block_proc;
3585
43461f26b729 (svn r4471) - Pools: Add a facility for calling a custom function during pool block clean up.
peter1138
parents: 3173
diff changeset
    38
	/// Pointer to a function that is called to clean a block
5216
8bd14ee39af2 (svn r7331) - Codechange: Rename all memory pool macro's and types to "old pool", so the new pool implementation can be committed alongside it.
matthijs
parents: 4986
diff changeset
    39
	OldMemoryPoolCleanBlock *clean_block_proc;
1259
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    40
3173
f56ca618721b (svn r3805) - [FS#62] Fix doxygen comments to refer to the correct parameter. (sulai)
peter1138
parents: 2436
diff changeset
    41
	uint current_blocks;        ///< How many blocks we have in our pool
f56ca618721b (svn r3805) - [FS#62] Fix doxygen comments to refer to the correct parameter. (sulai)
peter1138
parents: 2436
diff changeset
    42
	uint total_items;           ///< How many items we now have in this pool
f56ca618721b (svn r3805) - [FS#62] Fix doxygen comments to refer to the correct parameter. (sulai)
peter1138
parents: 2436
diff changeset
    43
7375
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    44
public:
3173
f56ca618721b (svn r3805) - [FS#62] Fix doxygen comments to refer to the correct parameter. (sulai)
peter1138
parents: 2436
diff changeset
    45
	byte **blocks;              ///< An array of blocks (one block hold all the items)
7375
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    46
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    47
	inline uint GetSize()
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    48
	{
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    49
		return this->total_items;
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    50
	}
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    51
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    52
	inline bool CanAllocateMoreBlocks()
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    53
	{
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    54
		return this->current_blocks < this->max_blocks;
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    55
	}
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    56
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    57
	inline uint GetBlockCount()
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    58
	{
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    59
		return this->current_blocks;
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    60
	}
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    61
};
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    62
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    63
template <typename T>
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    64
struct OldMemoryPool : public OldMemoryPoolBase {
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    65
	OldMemoryPool(const char *name, uint max_blocks, uint block_size_bits, uint item_size,
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    66
				OldMemoryPoolNewBlock *new_block_proc, OldMemoryPoolCleanBlock *clean_block_proc) :
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    67
		OldMemoryPoolBase(name, max_blocks, block_size_bits, item_size, new_block_proc, clean_block_proc) {}
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    68
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    69
	inline T *Get(uint index)
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    70
	{
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    71
		assert(index < this->GetSize());
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    72
		return (T*)(this->blocks[index >> this->block_size_bits] +
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    73
				(index & ((1 << this->block_size_bits) - 1)) * sizeof(T));
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    74
	}
1259
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    75
};
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    76
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    77
/**
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    78
 * Those are the wrappers:
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    79
 *   CleanPool cleans the pool up, but you can use AddBlockToPool directly again
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    80
 *     (no need to call CreatePool!)
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    81
 *   AddBlockToPool adds 1 more block to the pool. Returns false if there is no
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    82
 *     more room
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    83
 */
7375
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    84
static inline void CleanPool(OldMemoryPoolBase *array) { array->CleanPool(); }
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    85
static inline bool AddBlockToPool(OldMemoryPoolBase *array) { return array->AddBlockToPool(); }
1259
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    86
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    87
/**
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    88
 * Adds blocks to the pool if needed (and possible) till index fits inside the pool
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    89
 *
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    90
 * @return Returns false if adding failed
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    91
 */
7375
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
    92
static inline bool AddBlockIfNeeded(OldMemoryPoolBase *array, uint index) { return array->AddBlockIfNeeded(index); }
1259
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
diff changeset
    93
4970
eb2c0fde4b02 (svn r6973) Add macros to easily create a pool with less code duplication and more opportunities for constant expression evaluation
tron
parents: 3585
diff changeset
    94
5216
8bd14ee39af2 (svn r7331) - Codechange: Rename all memory pool macro's and types to "old pool", so the new pool implementation can be committed alongside it.
matthijs
parents: 4986
diff changeset
    95
#define OLD_POOL_ENUM(name, type, block_size_bits, max_blocks) \
4970
eb2c0fde4b02 (svn r6973) Add macros to easily create a pool with less code duplication and more opportunities for constant expression evaluation
tron
parents: 3585
diff changeset
    96
	enum { \
eb2c0fde4b02 (svn r6973) Add macros to easily create a pool with less code duplication and more opportunities for constant expression evaluation
tron
parents: 3585
diff changeset
    97
		name##_POOL_BLOCK_SIZE_BITS = block_size_bits, \
eb2c0fde4b02 (svn r6973) Add macros to easily create a pool with less code duplication and more opportunities for constant expression evaluation
tron
parents: 3585
diff changeset
    98
		name##_POOL_MAX_BLOCKS      = max_blocks \
eb2c0fde4b02 (svn r6973) Add macros to easily create a pool with less code duplication and more opportunities for constant expression evaluation
tron
parents: 3585
diff changeset
    99
	};
eb2c0fde4b02 (svn r6973) Add macros to easily create a pool with less code duplication and more opportunities for constant expression evaluation
tron
parents: 3585
diff changeset
   100
eb2c0fde4b02 (svn r6973) Add macros to easily create a pool with less code duplication and more opportunities for constant expression evaluation
tron
parents: 3585
diff changeset
   101
5216
8bd14ee39af2 (svn r7331) - Codechange: Rename all memory pool macro's and types to "old pool", so the new pool implementation can be committed alongside it.
matthijs
parents: 4986
diff changeset
   102
#define OLD_POOL_ACCESSORS(name, type) \
7375
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
   103
	static inline type* Get##name(uint index) { return _##name##_pool.Get(index);  } \
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
   104
	static inline uint Get##name##PoolSize()  { return _##name##_pool.GetSize(); }
4970
eb2c0fde4b02 (svn r6973) Add macros to easily create a pool with less code duplication and more opportunities for constant expression evaluation
tron
parents: 3585
diff changeset
   105
eb2c0fde4b02 (svn r6973) Add macros to easily create a pool with less code duplication and more opportunities for constant expression evaluation
tron
parents: 3585
diff changeset
   106
5216
8bd14ee39af2 (svn r7331) - Codechange: Rename all memory pool macro's and types to "old pool", so the new pool implementation can be committed alongside it.
matthijs
parents: 4986
diff changeset
   107
#define DECLARE_OLD_POOL(name, type, block_size_bits, max_blocks) \
8bd14ee39af2 (svn r7331) - Codechange: Rename all memory pool macro's and types to "old pool", so the new pool implementation can be committed alongside it.
matthijs
parents: 4986
diff changeset
   108
	OLD_POOL_ENUM(name, type, block_size_bits, max_blocks) \
7375
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
   109
	extern OldMemoryPool<type> _##name##_pool; \
5216
8bd14ee39af2 (svn r7331) - Codechange: Rename all memory pool macro's and types to "old pool", so the new pool implementation can be committed alongside it.
matthijs
parents: 4986
diff changeset
   110
	OLD_POOL_ACCESSORS(name, type)
4970
eb2c0fde4b02 (svn r6973) Add macros to easily create a pool with less code duplication and more opportunities for constant expression evaluation
tron
parents: 3585
diff changeset
   111
eb2c0fde4b02 (svn r6973) Add macros to easily create a pool with less code duplication and more opportunities for constant expression evaluation
tron
parents: 3585
diff changeset
   112
5216
8bd14ee39af2 (svn r7331) - Codechange: Rename all memory pool macro's and types to "old pool", so the new pool implementation can be committed alongside it.
matthijs
parents: 4986
diff changeset
   113
#define DEFINE_OLD_POOL(name, type, new_block_proc, clean_block_proc) \
7375
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
   114
	OldMemoryPool<type> _##name##_pool( \
4970
eb2c0fde4b02 (svn r6973) Add macros to easily create a pool with less code duplication and more opportunities for constant expression evaluation
tron
parents: 3585
diff changeset
   115
		#name, name##_POOL_MAX_BLOCKS, name##_POOL_BLOCK_SIZE_BITS, sizeof(type), \
7375
961ab798c4b6 (svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
rubidium
parents: 6351
diff changeset
   116
		new_block_proc, clean_block_proc);
4970
eb2c0fde4b02 (svn r6973) Add macros to easily create a pool with less code duplication and more opportunities for constant expression evaluation
tron
parents: 3585
diff changeset
   117
eb2c0fde4b02 (svn r6973) Add macros to easily create a pool with less code duplication and more opportunities for constant expression evaluation
tron
parents: 3585
diff changeset
   118
5216
8bd14ee39af2 (svn r7331) - Codechange: Rename all memory pool macro's and types to "old pool", so the new pool implementation can be committed alongside it.
matthijs
parents: 4986
diff changeset
   119
#define STATIC_OLD_POOL(name, type, block_size_bits, max_blocks, new_block_proc, clean_block_proc) \
8bd14ee39af2 (svn r7331) - Codechange: Rename all memory pool macro's and types to "old pool", so the new pool implementation can be committed alongside it.
matthijs
parents: 4986
diff changeset
   120
	OLD_POOL_ENUM(name, type, block_size_bits, max_blocks) \
8bd14ee39af2 (svn r7331) - Codechange: Rename all memory pool macro's and types to "old pool", so the new pool implementation can be committed alongside it.
matthijs
parents: 4986
diff changeset
   121
	static DEFINE_OLD_POOL(name, type, new_block_proc, clean_block_proc) \
8bd14ee39af2 (svn r7331) - Codechange: Rename all memory pool macro's and types to "old pool", so the new pool implementation can be committed alongside it.
matthijs
parents: 4986
diff changeset
   122
	OLD_POOL_ACCESSORS(name, type)
4970
eb2c0fde4b02 (svn r6973) Add macros to easily create a pool with less code duplication and more opportunities for constant expression evaluation
tron
parents: 3585
diff changeset
   123
5224
df36f84cbb6c (svn r7341) - Codechange: Also rename the POOL_H define to OLDPOOL_H (forgotten in r7331).
matthijs
parents: 5216
diff changeset
   124
#endif /* OLDPOOL_H */