Optimizes memory usage even further by removing the list initialization in gas mixture new() in favor of having the lists start as empty lists. seems to save about 20mb of memory on box judging from one unscientific single test
This commit is contained in:
@@ -240,8 +240,11 @@
|
||||
//HELPERS
|
||||
#define THERMAL_ENERGY(gas) (gas.temperature * gas.heat_capacity())
|
||||
|
||||
|
||||
//REMOVE REMOVE REMOVE REMOVE
|
||||
#define ADD_GAS(gas_id, out_list) out_list[gas_id] = 0
|
||||
|
||||
//REMOVEREMOVEREMOVE
|
||||
#define ASSERT_GAS(gas_id, gas_mixture) if (!gas_mixture.gases[gas_id]) { ADD_GAS(gas_id, gas_mixture.gases) };
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user