(svn r16378) -Codechange: replace OldPool with simpler Pool. Compilation time, binary size and run time (with asserts disabled) should be improved

This commit is contained in:
smatz
2009-05-22 15:13:50 +00:00
parent 04723b240e
commit 62a7948af0
69 changed files with 834 additions and 995 deletions

View File

@@ -20,9 +20,15 @@
#include "aircraft.h"
#include "vehicle_gui.h"
#include "settings_type.h"
#include "core/pool_func.hpp"
#include "table/strings.h"
StationPool _station_pool("Station");
INSTANTIATE_POOL_METHODS(Station)
RoadStopPool _roadstop_pool("RoadStop");
INSTANTIATE_POOL_METHODS(RoadStop)
Station::Station(TileIndex tile)
{
DEBUG(station, cDebugCtorLevel, "I+%3d", index);
@@ -88,8 +94,6 @@ Station::~Station()
/* Remove all news items */
DeleteStationNews(this->index);
xy = INVALID_TILE;
InvalidateWindowData(WC_SELECT_STATION, 0, 0);
for (CargoID c = 0; c < NUM_CARGO; c++) {
@@ -460,8 +464,6 @@ RoadStop::~RoadStop()
assert(num_vehicles == 0);
DEBUG(ms, cDebugCtorLevel , "I- at %d[0x%x]", xy, xy);
xy = INVALID_TILE;
}
/** Checks whether there is a free bay in this road stop */
@@ -546,3 +548,9 @@ RoadStop *RoadStop::GetNextRoadStop(const Vehicle *v) const
return NULL;
}
void InitializeStations()
{
_station_pool.CleanPool();
_roadstop_pool.CleanPool();
}