Fix a issue that may delete used slots in trash pool
Fix compatibility issue with other mods (expecially DSPOptimizations) by calling SetXXXCapacity() on shrinking capacity of pools
0.9.1
Fix a bug that may cause game crash on shrinking storage memory pools.
Notes
Does not optimize some rarely uses pools, mostly UI related.
Does not optimize solar sails' pool, please use button on dyson sphere panel from original game to clean it up.
Mechanism
The game uses a lot of memory pools in array to store data, sizes and capacities of these pools are increased on demand but never decreased, even most data inside are not used due to dismantle objects. Unused slot IDs are save in recycle array for reuse.
Some game functions loop through all allocated slots in the pool, so the size of the pool will affect the performance.
This mod will optimize the memory pools when loading gamesaves, strip the unused slots from tail and reduce the size of the pool and recycle array, for better performance.
TODO
Remove the unused slots from middle of the pool, which leads to ID change for stored objects, needs more investigation.