(svn r7331) - Codechange: Rename all memory pool macro's and types to "old pool", so the new pool implementation can be committed alongside it.
authormatthijs
Sun, 03 Dec 2006 17:27:43 +0000
changeset 5216 d581e4db95b6
parent 5215 439d5ca71311
child 5217 21c23507c002
(svn r7331) - Codechange: Rename all memory pool macro's and types to "old pool", so the new pool implementation can be committed alongside it.
- Codechange: Rename pool.[ch] to oldpool.[ch].
Makefile
depot.c
depot.h
engine.c
engine.h
industry.h
industry_cmd.c
newgrf_sound.c
newgrf_spritegroup.c
oldpool.c
oldpool.h
openttd.tgt
openttd.vcproj
openttd_vs80.vcproj
order.h
order_cmd.c
player.h
pool.c
pool.h
saveload.c
signs.c
signs.h
station.h
station_cmd.c
town.h
town_cmd.c
vehicle.c
vehicle.h
waypoint.c
waypoint.h
--- a/Makefile	Sun Dec 03 15:48:21 2006 +0000
+++ b/Makefile	Sun Dec 03 17:27:43 2006 +0000
@@ -741,6 +741,7 @@
 SRCS += news_gui.c
 SRCS += npf.c
 SRCS += oldloader.c
+SRCS += oldpool.c
 SRCS += openttd.c
 SRCS += order_cmd.c
 SRCS += order_gui.c
@@ -748,7 +749,6 @@
 SRCS += pathfind.c
 SRCS += player_gui.c
 SRCS += players.c
-SRCS += pool.c
 SRCS += queue.c
 SRCS += rail.c
 SRCS += rail_cmd.c
--- a/depot.c	Sun Dec 03 15:48:21 2006 +0000
+++ b/depot.c	Sun Dec 03 17:27:43 2006 +0000
@@ -23,7 +23,7 @@
 	for (d = GetDepot(start_item); d != NULL; d = (d->index + 1U < GetDepotPoolSize()) ? GetDepot(d->index + 1U) : NULL) d->index = start_item++;
 }
 
-DEFINE_POOL(Depot, Depot, DepotPoolNewBlock, NULL)
+DEFINE_OLD_POOL(Depot, Depot, DepotPoolNewBlock, NULL)
 
 
 /**
--- a/depot.h	Sun Dec 03 15:48:21 2006 +0000
+++ b/depot.h	Sun Dec 03 17:27:43 2006 +0000
@@ -7,7 +7,7 @@
  *  @see depot.c */
 
 #include "direction.h"
-#include "pool.h"
+#include "oldpool.h"
 #include "tile.h"
 #include "variables.h"
 
@@ -17,7 +17,7 @@
 	DepotID index;
 };
 
-DECLARE_POOL(Depot, Depot, 3, 8000)
+DECLARE_OLD_POOL(Depot, Depot, 3, 8000)
 
 /**
  * Check if a depot really exists.
--- a/engine.c	Sun Dec 03 15:48:21 2006 +0000
+++ b/engine.c	Sun Dec 03 17:27:43 2006 +0000
@@ -431,7 +431,7 @@
 
 static void EngineRenewPoolNewBlock(uint start_item);
 
-DEFINE_POOL(EngineRenew, EngineRenew, EngineRenewPoolNewBlock, NULL)
+DEFINE_OLD_POOL(EngineRenew, EngineRenew, EngineRenewPoolNewBlock, NULL)
 
 static void EngineRenewPoolNewBlock(uint start_item)
 {
--- a/engine.h	Sun Dec 03 15:48:21 2006 +0000
+++ b/engine.h	Sun Dec 03 17:27:43 2006 +0000
@@ -5,7 +5,7 @@
 
 /** @file engine.h */
 
-#include "pool.h"
+#include "oldpool.h"
 
 typedef struct RailVehicleInfo {
 	byte image_index;
@@ -235,7 +235,7 @@
  * placed here so the only exception to this rule, the saveload code, can use
  * it.
  */
-DECLARE_POOL(EngineRenew, EngineRenew, 3, 8000)
+DECLARE_OLD_POOL(EngineRenew, EngineRenew, 3, 8000)
 
 /**
  * Check if a EngineRenew really exists.
--- a/industry.h	Sun Dec 03 15:48:21 2006 +0000
+++ b/industry.h	Sun Dec 03 17:27:43 2006 +0000
@@ -3,7 +3,7 @@
 #ifndef INDUSTRY_H
 #define INDUSTRY_H
 
-#include "pool.h"
+#include "oldpool.h"
 
 typedef byte IndustryGfx;
 typedef uint8 IndustryType;
@@ -80,7 +80,7 @@
 
 const IndustrySpec *GetIndustrySpec(IndustryType thistype);
 
-DECLARE_POOL(Industry, Industry, 3, 8000)
+DECLARE_OLD_POOL(Industry, Industry, 3, 8000)
 
 /**
  * Check if an Industry really exists.
--- a/industry_cmd.c	Sun Dec 03 15:48:21 2006 +0000
+++ b/industry_cmd.c	Sun Dec 03 17:27:43 2006 +0000
@@ -45,7 +45,7 @@
 	for (i = GetIndustry(start_item); i != NULL; i = (i->index + 1U < GetIndustryPoolSize()) ? GetIndustry(i->index + 1U) : NULL) i->index = start_item++;
 }
 
-DEFINE_POOL(Industry, Industry, IndustryPoolNewBlock, NULL)
+DEFINE_OLD_POOL(Industry, Industry, IndustryPoolNewBlock, NULL)
 
 /**
  * Retrieve the type for this industry.  Although it is accessed by a tile,
--- a/newgrf_sound.c	Sun Dec 03 15:48:21 2006 +0000
+++ b/newgrf_sound.c	Sun Dec 03 17:27:43 2006 +0000
@@ -2,7 +2,7 @@
 
 #include "stdafx.h"
 #include "openttd.h"
-#include "pool.h"
+#include "oldpool.h"
 #include "sound.h"
 #include "engine.h"
 #include "vehicle.h"
@@ -11,7 +11,7 @@
 #include "newgrf_sound.h"
 
 static uint _sound_count = 0;
-STATIC_POOL(SoundInternal, FileEntry, 3, 1000, NULL, NULL)
+STATIC_OLD_POOL(SoundInternal, FileEntry, 3, 1000, NULL, NULL)
 
 
 /* Allocate a new FileEntry */
--- a/newgrf_spritegroup.c	Sun Dec 03 15:48:21 2006 +0000
+++ b/newgrf_spritegroup.c	Sun Dec 03 17:27:43 2006 +0000
@@ -4,14 +4,14 @@
 #include "openttd.h"
 #include "variables.h"
 #include "macros.h"
-#include "pool.h"
+#include "oldpool.h"
 #include "newgrf_spritegroup.h"
 #include "date.h"
 
 static void SpriteGroupPoolCleanBlock(uint start_item, uint end_item);
 
 static uint _spritegroup_count = 0;
-STATIC_POOL(SpriteGroup, SpriteGroup, 4, 8000, NULL, SpriteGroupPoolCleanBlock)
+STATIC_OLD_POOL(SpriteGroup, SpriteGroup, 4, 8000, NULL, SpriteGroupPoolCleanBlock)
 
 static void DestroySpriteGroup(SpriteGroup *group)
 {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/oldpool.c	Sun Dec 03 17:27:43 2006 +0000
@@ -0,0 +1,87 @@
+/* $Id$ */
+
+#include "stdafx.h"
+#include "openttd.h"
+#include "debug.h"
+#include "functions.h"
+#include "oldpool.h"
+
+/**
+ * Clean a pool in a safe way (does free all blocks)
+ */
+void CleanPool(OldMemoryPool *pool)
+{
+	uint i;
+
+	DEBUG(misc, 4)("[Pool] (%s) Cleaning pool..", pool->name);
+
+	/* Free all blocks */
+	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);
+
+	/* Clear up some critical data */
+	pool->total_items = 0;
+	pool->current_blocks = 0;
+	pool->blocks = NULL;
+}
+
+/**
+ * This function tries to increase the size of array by adding
+ *  1 block too it
+ *
+ * @return Returns false if the pool could not be increased
+ */
+bool AddBlockToPool(OldMemoryPool *pool)
+{
+	/* Is the pool at his max? */
+	if (pool->max_blocks == pool->current_blocks)
+		return false;
+
+	pool->total_items = (pool->current_blocks + 1) * (1 << pool->block_size_bits);
+
+	DEBUG(misc, 4)("[Pool] (%s) Increasing size of pool to %d items (%d bytes)", pool->name, pool->total_items, pool->total_items * pool->item_size);
+
+	/* Increase the poolsize */
+	pool->blocks = realloc(pool->blocks, sizeof(pool->blocks[0]) * (pool->current_blocks + 1));
+	if (pool->blocks == NULL)
+		error("Pool: (%s) could not allocate memory for blocks", pool->name);
+
+	/* Allocate memory to the new block item */
+	pool->blocks[pool->current_blocks] = malloc(pool->item_size * (1 << pool->block_size_bits));
+	if (pool->blocks[pool->current_blocks] == NULL)
+		error("Pool: (%s) could not allocate memory for blocks", pool->name);
+
+	/* Clean the content of the new block */
+	memset(pool->blocks[pool->current_blocks], 0, pool->item_size * (1 << pool->block_size_bits));
+
+	/* Call a custom function if defined (e.g. to fill indexes) */
+	if (pool->new_block_proc != NULL)
+		pool->new_block_proc(pool->current_blocks * (1 << pool->block_size_bits));
+
+	/* We have a new block */
+	pool->current_blocks++;
+
+	return true;
+}
+
+/**
+ * Adds blocks to the pool if needed (and possible) till index fits inside the pool
+ *
+ * @return Returns false if adding failed
+ */
+bool AddBlockIfNeeded(OldMemoryPool *pool, uint index)
+{
+	while (index >= pool->total_items) {
+		if (!AddBlockToPool(pool))
+			return false;
+	}
+
+	return true;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/oldpool.h	Sun Dec 03 17:27:43 2006 +0000
@@ -0,0 +1,96 @@
+/* $Id$ */
+
+#ifndef POOL_H
+#define POOL_H
+
+typedef struct OldMemoryPool OldMemoryPool;
+
+/* The function that is called after a new block is added
+     start_item is the first item of the new made block */
+typedef void OldMemoryPoolNewBlock(uint start_item);
+/* The function that is called before a block is cleaned up */
+typedef void OldMemoryPoolCleanBlock(uint start_item, uint end_item);
+
+/**
+ * Stuff for dynamic vehicles. Use the wrappers to access the OldMemoryPool
+ *  please try to avoid manual calls!
+ */
+struct OldMemoryPool {
+	const char* const name;     ///< Name of the pool (just for debugging)
+
+	const uint max_blocks;      ///< The max amount of blocks this pool can have
+	const uint block_size_bits; ///< The size of each block in bits
+	const uint item_size;       ///< How many bytes one block is
+
+	/// Pointer to a function that is called after a new block is added
+	OldMemoryPoolNewBlock *new_block_proc;
+	/// Pointer to a function that is called to clean a block
+	OldMemoryPoolCleanBlock *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
+
+	byte **blocks;              ///< An array of blocks (one block hold all the items)
+};
+
+/**
+ * Those are the wrappers:
+ *   CleanPool cleans the pool up, but you can use AddBlockToPool directly again
+ *     (no need to call CreatePool!)
+ *   AddBlockToPool adds 1 more block to the pool. Returns false if there is no
+ *     more room
+ */
+void CleanPool(OldMemoryPool *array);
+bool AddBlockToPool(OldMemoryPool *array);
+
+/**
+ * Adds blocks to the pool if needed (and possible) till index fits inside the pool
+ *
+ * @return Returns false if adding failed
+ */
+bool AddBlockIfNeeded(OldMemoryPool *array, uint index);
+
+
+#define OLD_POOL_ENUM(name, type, block_size_bits, max_blocks) \
+	enum { \
+		name##_POOL_BLOCK_SIZE_BITS = block_size_bits, \
+		name##_POOL_MAX_BLOCKS      = max_blocks \
+	};
+
+
+#define OLD_POOL_ACCESSORS(name, type) \
+	static inline type* Get##name(uint index) \
+	{ \
+		assert(index < _##name##_pool.total_items); \
+		return (type*)( \
+			_##name##_pool.blocks[index >> name##_POOL_BLOCK_SIZE_BITS] + \
+			(index & ((1 << name##_POOL_BLOCK_SIZE_BITS) - 1)) * sizeof(type) \
+		); \
+	} \
+\
+	static inline uint Get##name##PoolSize(void) \
+	{ \
+		return _##name##_pool.total_items; \
+	}
+
+
+#define DECLARE_OLD_POOL(name, type, block_size_bits, max_blocks) \
+	OLD_POOL_ENUM(name, type, block_size_bits, max_blocks) \
+	extern OldMemoryPool _##name##_pool; \
+	OLD_POOL_ACCESSORS(name, type)
+
+
+#define DEFINE_OLD_POOL(name, type, new_block_proc, clean_block_proc) \
+	OldMemoryPool _##name##_pool = { \
+		#name, name##_POOL_MAX_BLOCKS, name##_POOL_BLOCK_SIZE_BITS, sizeof(type), \
+		new_block_proc, clean_block_proc, \
+		0, 0, NULL \
+	};
+
+
+#define STATIC_OLD_POOL(name, type, block_size_bits, max_blocks, new_block_proc, clean_block_proc) \
+	OLD_POOL_ENUM(name, type, block_size_bits, max_blocks) \
+	static DEFINE_OLD_POOL(name, type, new_block_proc, clean_block_proc) \
+	OLD_POOL_ACCESSORS(name, type)
+
+#endif /* POOL_H */
--- a/openttd.tgt	Sun Dec 03 15:48:21 2006 +0000
+++ b/openttd.tgt	Sun Dec 03 17:27:43 2006 +0000
@@ -1687,7 +1687,7 @@
 387
 MItem
 6
-pool.c
+oldpool.c
 388
 WString
 4
--- a/openttd.vcproj	Sun Dec 03 15:48:21 2006 +0000
+++ b/openttd.vcproj	Sun Dec 03 17:27:43 2006 +0000
@@ -361,7 +361,7 @@
 				RelativePath="players.c">
 			</File>
 			<File
-				RelativePath=".\pool.c">
+				RelativePath=".\oldpool.c">
 			</File>
 			<File
 				RelativePath=".\queue.c">
@@ -611,7 +611,7 @@
 				RelativePath=".\player.h">
 			</File>
 			<File
-				RelativePath=".\pool.h">
+				RelativePath=".\oldpool.h">
 			</File>
 			<File
 				RelativePath=".\queue.h">
--- a/openttd_vs80.vcproj	Sun Dec 03 15:48:21 2006 +0000
+++ b/openttd_vs80.vcproj	Sun Dec 03 17:27:43 2006 +0000
@@ -729,7 +729,7 @@
 				>
 			</File>
 			<File
-				RelativePath=".\pool.c"
+				RelativePath=".\oldpool.c"
 				>
 			</File>
 			<File
@@ -1112,7 +1112,7 @@
 				>
 			</File>
 			<File
-				RelativePath=".\pool.h"
+				RelativePath=".\oldpool.h"
 				>
 			</File>
 			<File
--- a/order.h	Sun Dec 03 15:48:21 2006 +0000
+++ b/order.h	Sun Dec 03 17:27:43 2006 +0000
@@ -6,7 +6,7 @@
 #define ORDER_H
 
 #include "macros.h"
-#include "pool.h"
+#include "oldpool.h"
 
 enum {
 	INVALID_VEH_ORDER_ID = 0xFF,
@@ -107,7 +107,7 @@
 VARDEF TileIndex _backup_orders_tile;
 VARDEF BackuppedOrders _backup_orders_data[1];
 
-DECLARE_POOL(Order, Order, 6, 1000)
+DECLARE_OLD_POOL(Order, Order, 6, 1000)
 
 static inline VehicleOrderID GetOrderArraySize(void)
 {
--- a/order_cmd.c	Sun Dec 03 15:48:21 2006 +0000
+++ b/order_cmd.c	Sun Dec 03 17:27:43 2006 +0000
@@ -28,7 +28,7 @@
 	for (order = GetOrder(start_item); order != NULL; order = (order->index + 1U < GetOrderPoolSize()) ? GetOrder(order->index + 1U) : NULL) order->index = start_item++;
 }
 
-DEFINE_POOL(Order, Order, OrderPoolNewBlock, NULL)
+DEFINE_OLD_POOL(Order, Order, OrderPoolNewBlock, NULL)
 
 /**
  *
--- a/player.h	Sun Dec 03 15:48:21 2006 +0000
+++ b/player.h	Sun Dec 03 17:27:43 2006 +0000
@@ -3,7 +3,7 @@
 #ifndef PLAYER_H
 #define PLAYER_H
 
-#include "pool.h"
+#include "oldpool.h"
 #include "aystar.h"
 #include "rail.h"
 #include "engine.h"
--- a/pool.c	Sun Dec 03 15:48:21 2006 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/* $Id$ */
-
-#include "stdafx.h"
-#include "openttd.h"
-#include "debug.h"
-#include "functions.h"
-#include "pool.h"
-
-/**
- * Clean a pool in a safe way (does free all blocks)
- */
-void CleanPool(MemoryPool *pool)
-{
-	uint i;
-
-	DEBUG(misc, 4)("[Pool] (%s) Cleaning pool..", pool->name);
-
-	/* Free all blocks */
-	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);
-
-	/* Clear up some critical data */
-	pool->total_items = 0;
-	pool->current_blocks = 0;
-	pool->blocks = NULL;
-}
-
-/**
- * This function tries to increase the size of array by adding
- *  1 block too it
- *
- * @return Returns false if the pool could not be increased
- */
-bool AddBlockToPool(MemoryPool *pool)
-{
-	/* Is the pool at his max? */
-	if (pool->max_blocks == pool->current_blocks)
-		return false;
-
-	pool->total_items = (pool->current_blocks + 1) * (1 << pool->block_size_bits);
-
-	DEBUG(misc, 4)("[Pool] (%s) Increasing size of pool to %d items (%d bytes)", pool->name, pool->total_items, pool->total_items * pool->item_size);
-
-	/* Increase the poolsize */
-	pool->blocks = realloc(pool->blocks, sizeof(pool->blocks[0]) * (pool->current_blocks + 1));
-	if (pool->blocks == NULL)
-		error("Pool: (%s) could not allocate memory for blocks", pool->name);
-
-	/* Allocate memory to the new block item */
-	pool->blocks[pool->current_blocks] = malloc(pool->item_size * (1 << pool->block_size_bits));
-	if (pool->blocks[pool->current_blocks] == NULL)
-		error("Pool: (%s) could not allocate memory for blocks", pool->name);
-
-	/* Clean the content of the new block */
-	memset(pool->blocks[pool->current_blocks], 0, pool->item_size * (1 << pool->block_size_bits));
-
-	/* Call a custom function if defined (e.g. to fill indexes) */
-	if (pool->new_block_proc != NULL)
-		pool->new_block_proc(pool->current_blocks * (1 << pool->block_size_bits));
-
-	/* We have a new block */
-	pool->current_blocks++;
-
-	return true;
-}
-
-/**
- * Adds blocks to the pool if needed (and possible) till index fits inside the pool
- *
- * @return Returns false if adding failed
- */
-bool AddBlockIfNeeded(MemoryPool *pool, uint index)
-{
-	while (index >= pool->total_items) {
-		if (!AddBlockToPool(pool))
-			return false;
-	}
-
-	return true;
-}
--- a/pool.h	Sun Dec 03 15:48:21 2006 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/* $Id$ */
-
-#ifndef POOL_H
-#define POOL_H
-
-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
- *  please try to avoid manual calls!
- */
-struct MemoryPool {
-	const char* const name;     ///< Name of the pool (just for debugging)
-
-	const uint max_blocks;      ///< The max amount of blocks this pool can have
-	const uint block_size_bits; ///< The size of each block in bits
-	const uint item_size;       ///< How many bytes one block is
-
-	/// 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
-
-	byte **blocks;              ///< An array of blocks (one block hold all the items)
-};
-
-/**
- * Those are the wrappers:
- *   CleanPool cleans the pool up, but you can use AddBlockToPool directly again
- *     (no need to call CreatePool!)
- *   AddBlockToPool adds 1 more block to the pool. Returns false if there is no
- *     more room
- */
-void CleanPool(MemoryPool *array);
-bool AddBlockToPool(MemoryPool *array);
-
-/**
- * Adds blocks to the pool if needed (and possible) till index fits inside the pool
- *
- * @return Returns false if adding failed
- */
-bool AddBlockIfNeeded(MemoryPool *array, uint index);
-
-
-#define POOL_ENUM(name, type, block_size_bits, max_blocks) \
-	enum { \
-		name##_POOL_BLOCK_SIZE_BITS = block_size_bits, \
-		name##_POOL_MAX_BLOCKS      = max_blocks \
-	};
-
-
-#define POOL_ACCESSORS(name, type) \
-	static inline type* Get##name(uint index) \
-	{ \
-		assert(index < _##name##_pool.total_items); \
-		return (type*)( \
-			_##name##_pool.blocks[index >> name##_POOL_BLOCK_SIZE_BITS] + \
-			(index & ((1 << name##_POOL_BLOCK_SIZE_BITS) - 1)) * sizeof(type) \
-		); \
-	} \
-\
-	static inline uint Get##name##PoolSize(void) \
-	{ \
-		return _##name##_pool.total_items; \
-	}
-
-
-#define DECLARE_POOL(name, type, block_size_bits, max_blocks) \
-	POOL_ENUM(name, type, block_size_bits, max_blocks) \
-	extern MemoryPool _##name##_pool; \
-	POOL_ACCESSORS(name, type)
-
-
-#define DEFINE_POOL(name, type, new_block_proc, clean_block_proc) \
-	MemoryPool _##name##_pool = { \
-		#name, name##_POOL_MAX_BLOCKS, name##_POOL_BLOCK_SIZE_BITS, sizeof(type), \
-		new_block_proc, clean_block_proc, \
-		0, 0, NULL \
-	};
-
-
-#define STATIC_POOL(name, type, block_size_bits, max_blocks, new_block_proc, clean_block_proc) \
-	POOL_ENUM(name, type, block_size_bits, max_blocks) \
-	static DEFINE_POOL(name, type, new_block_proc, clean_block_proc) \
-	POOL_ACCESSORS(name, type)
-
-#endif /* POOL_H */
--- a/saveload.c	Sun Dec 03 15:48:21 2006 +0000
+++ b/saveload.c	Sun Dec 03 17:27:43 2006 +0000
@@ -1056,7 +1056,7 @@
 } ThreadedSave;
 
 /* A maximum size of of 128K * 500 = 64.000KB savegames */
-STATIC_POOL(Savegame, byte, 17, 500, NULL, NULL)
+STATIC_OLD_POOL(Savegame, byte, 17, 500, NULL, NULL)
 static ThreadedSave _ts;
 
 static bool InitMem(void)
--- a/signs.c	Sun Dec 03 15:48:21 2006 +0000
+++ b/signs.c	Sun Dec 03 17:27:43 2006 +0000
@@ -25,7 +25,7 @@
 }
 
 /* Initialize the sign-pool */
-DEFINE_POOL(Sign, Sign, SignPoolNewBlock, NULL)
+DEFINE_OLD_POOL(Sign, Sign, SignPoolNewBlock, NULL)
 
 /**
  *
--- a/signs.h	Sun Dec 03 15:48:21 2006 +0000
+++ b/signs.h	Sun Dec 03 17:27:43 2006 +0000
@@ -3,7 +3,7 @@
 #ifndef SIGNS_H
 #define SIGNS_H
 
-#include "pool.h"
+#include "oldpool.h"
 
 typedef struct Sign {
 	StringID     str;
@@ -16,7 +16,7 @@
 	SignID       index;
 } Sign;
 
-DECLARE_POOL(Sign, Sign, 2, 16000)
+DECLARE_OLD_POOL(Sign, Sign, 2, 16000)
 
 static inline SignID GetSignArraySize(void)
 {
--- a/station.h	Sun Dec 03 15:48:21 2006 +0000
+++ b/station.h	Sun Dec 03 17:27:43 2006 +0000
@@ -4,7 +4,7 @@
 #define STATION_H
 
 #include "player.h"
-#include "pool.h"
+#include "oldpool.h"
 #include "sprite.h"
 #include "tile.h"
 #include "newgrf_station.h"
@@ -142,7 +142,7 @@
 void RebuildStationLists(void);
 void ResortStationLists(void);
 
-DECLARE_POOL(Station, Station, 6, 1000)
+DECLARE_OLD_POOL(Station, Station, 6, 1000)
 
 static inline StationID GetStationArraySize(void)
 {
@@ -181,7 +181,7 @@
 
 /* Stuff for ROADSTOPS */
 
-DECLARE_POOL(RoadStop, RoadStop, 5, 2000)
+DECLARE_OLD_POOL(RoadStop, RoadStop, 5, 2000)
 
 /**
  * Check if a RaodStop really exists.
--- a/station_cmd.c	Sun Dec 03 15:48:21 2006 +0000
+++ b/station_cmd.c	Sun Dec 03 17:27:43 2006 +0000
@@ -68,8 +68,8 @@
 	for (rs = GetRoadStop(start_item); rs != NULL; rs = (rs->index + 1U < GetRoadStopPoolSize()) ? GetRoadStop(rs->index + 1U) : NULL) rs->index = start_item++;
 }
 
-DEFINE_POOL(Station, Station, StationPoolNewBlock, StationPoolCleanBlock)
-DEFINE_POOL(RoadStop, RoadStop, RoadStopPoolNewBlock, NULL)
+DEFINE_OLD_POOL(Station, Station, StationPoolNewBlock, StationPoolCleanBlock)
+DEFINE_OLD_POOL(RoadStop, RoadStop, RoadStopPoolNewBlock, NULL)
 
 
 extern void UpdateAirplanesOnNewStation(Station *st);
--- a/town.h	Sun Dec 03 15:48:21 2006 +0000
+++ b/town.h	Sun Dec 03 17:27:43 2006 +0000
@@ -3,7 +3,7 @@
 #ifndef TOWN_H
 #define TOWN_H
 
-#include "pool.h"
+#include "oldpool.h"
 #include "player.h"
 
 struct Town {
@@ -152,7 +152,7 @@
 
 VARDEF const Town** _town_sort;
 
-DECLARE_POOL(Town, Town, 3, 8000)
+DECLARE_OLD_POOL(Town, Town, 3, 8000)
 
 /**
  * Check if a Town really exists.
--- a/town_cmd.c	Sun Dec 03 15:48:21 2006 +0000
+++ b/town_cmd.c	Sun Dec 03 17:27:43 2006 +0000
@@ -43,7 +43,7 @@
 }
 
 /* Initialize the town-pool */
-DEFINE_POOL(Town, Town, TownPoolNewBlock, NULL)
+DEFINE_OLD_POOL(Town, Town, TownPoolNewBlock, NULL)
 
 void DestroyTown(Town *t)
 {
--- a/vehicle.c	Sun Dec 03 15:48:21 2006 +0000
+++ b/vehicle.c	Sun Dec 03 17:27:43 2006 +0000
@@ -95,7 +95,7 @@
 }
 
 /* Initialize the vehicle-pool */
-DEFINE_POOL(Vehicle, Vehicle, VehiclePoolNewBlock, NULL)
+DEFINE_OLD_POOL(Vehicle, Vehicle, VehiclePoolNewBlock, NULL)
 
 void VehicleServiceInDepot(Vehicle *v)
 {
--- a/vehicle.h	Sun Dec 03 15:48:21 2006 +0000
+++ b/vehicle.h	Sun Dec 03 17:27:43 2006 +0000
@@ -3,7 +3,7 @@
 #ifndef VEHICLE_H
 #define VEHICLE_H
 
-#include "pool.h"
+#include "oldpool.h"
 #include "order.h"
 #include "rail.h"
 
@@ -368,7 +368,7 @@
 #define BEGIN_ENUM_WAGONS(v) do {
 #define END_ENUM_WAGONS(v) } while ( (v=v->next) != NULL);
 
-DECLARE_POOL(Vehicle, Vehicle, 9, 125)
+DECLARE_OLD_POOL(Vehicle, Vehicle, 9, 125)
 
 static inline VehicleID GetVehicleArraySize(void)
 {
--- a/waypoint.c	Sun Dec 03 15:48:21 2006 +0000
+++ b/waypoint.c	Sun Dec 03 17:27:43 2006 +0000
@@ -36,7 +36,7 @@
 	for (wp = GetWaypoint(start_item); wp != NULL; wp = (wp->index + 1U < GetWaypointPoolSize()) ? GetWaypoint(wp->index + 1U) : NULL) wp->index = start_item++;
 }
 
-DEFINE_POOL(Waypoint, Waypoint, WaypointPoolNewBlock, NULL)
+DEFINE_OLD_POOL(Waypoint, Waypoint, WaypointPoolNewBlock, NULL)
 
 /* Create a new waypoint */
 static Waypoint* AllocateWaypoint(void)
--- a/waypoint.h	Sun Dec 03 15:48:21 2006 +0000
+++ b/waypoint.h	Sun Dec 03 17:27:43 2006 +0000
@@ -3,7 +3,7 @@
 #ifndef WAYPOINT_H
 #define WAYPOINT_H
 
-#include "pool.h"
+#include "oldpool.h"
 #include "rail_map.h"
 
 struct Waypoint {
@@ -24,7 +24,7 @@
 	byte deleted;      ///< Delete counter. If greater than 0 then it is decremented until it reaches 0; the waypoint is then is deleted.
 };
 
-DECLARE_POOL(Waypoint, Waypoint, 3, 8000)
+DECLARE_OLD_POOL(Waypoint, Waypoint, 3, 8000)
 
 /**
  * Check if a Waypoint really exists.