anchor.diff:  		var/delta_pressure = temperature_archived*(total_moles() + moved_moles) - sharer.temperature_archived*(sharer.total_moles() - moved_moles)
   		. = delta_pressure * R_IDEAL_GAS_EQUATION / volume
   
  -	garbage_collect()
  -	sharer.garbage_collect()
  +	garbage_collect(cached_gases - sharer_gases) //any gases the sharer had, we are guaranteed to have. gases that it didn't have we are not.
  +	sharer.garbage_collect(sharer_gases - cached_gases) //the reverse is equally true
   
   /datum/gas_mixture/mimic(turf/model, atmos_adjacent_turfs = 4)
   	var/datum/gas_mixture/copied = new
  
positive.code: 		add_gas(id)
  
  	//garbage_collect() - removes any gas list which is empty.
  	//Must be used after subtracting from a gas. Must be used after assert_gas()
  		//if assert_gas() was called only to read from the gas.
  	//By removing empty gases, processing speed is increased.
  /datum/gas_mixture/proc/garbage_collect()
  	var/list/cached_gases = gases
  	for(var/id in cached_gases)
  		if(cached_gases[id][MOLES] <= 0 && cached_gases[id][ARCHIVE] <= 0)
  			cached_gases -= id
  
  	//PV = nRT
  /datum/gas_mixture/proc/heat_capacity()
  	var/list/cached_gases = gases
  	. = 0
  	for(var/id in cached_gases)
  		. += cached_gases[id][MOLES] * cached_gases[id][GAS_META][META_GAS_SPECIFIC_HEAT]
  
  /datum/gas_mixture/proc/heat_capacity_archived()
  	var/list/cached_gases = gases
  	. = 0
  	for(var/id in cached_gases)
  		. += cached_gases[id][ARCHIVE] * cached_gases[id][GAS_META][META_GAS_SPECIFIC_HEAT]
  
  /datum/gas_mixture/proc/total_moles()
  	var/list/cached_gases = gases
  	. = 0
  	for(var/id in cached_gases)
  		. += cached_gases[id][MOLES]
  
  /datum/gas_mixture/proc/return_pressure()
  	if(volume > 0) // to prevent division by zero
  		return total_moles() * R_IDEAL_GAS_EQUATION * temperature / volume
  	return 0
  
  /datum/gas_mixture/proc/return_temperature()
  	return temperature
  
  /datum/gas_mixture/proc/return_volume()
  	return max(0, volume)
  
  /datum/gas_mixture/proc/thermal_energy()
  	return temperature * heat_capacity()
  
  //Procedures used for very specific events
  
negative.code: 	cached_gases["n2"][MOLES]		= model.nitrogen
  	cached_gases["plasma"][MOLES]	= model.toxins
  	cached_gases["co2"][MOLES]		= model.carbon_dioxide
  	//remove all gases not handled by turfs
  	cached_gases &= hardcoded_gases
  
  	return 1
  