Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Memory

It is important to use memory effienctly when building simulations that run over extended periods of time.

Any time an object is added to the unit simulation, the unit simulation is responsible for freeing that object. This includes, units, unitGroups, and abstract maps. Maps, which are added to mapAbstractions, will be freed by the mapAbstraction. Similarly, algorithms added to searchUnits will be freed by the searchUnit when appropriate.

New code should follow the general guideline that when one object is added to another, the parent object is in charge of freeing memory for the other object upon termination. Units and unitGroups are both added to each other, but they are also both added to the unit simulation, so the simulation is responsible for deallocating both of these objects.

Prev: Starting Next: CVS


Generated on Tue Aug 18 03:46:10 2009 for HOG by doxygen 1.3.4