Skip to content

Utils: gc

Garbage collection utilities.

Removes unreachable entities from the state.

An entity is considered reachable if it is present in the position map, or referenced by status effects or inventories of other reachable entities.

compute_alive_entities(state)

Compute the set of all reachable entity IDs in the state.

run_garbage_collector(state)

Return a new state with unreachable entities removed.