diff options
Diffstat (limited to 'engines/sci/engine/gc.h')
-rw-r--r-- | engines/sci/engine/gc.h | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/engines/sci/engine/gc.h b/engines/sci/engine/gc.h index 9f9347ca18..f4318a1453 100644 --- a/engines/sci/engine/gc.h +++ b/engines/sci/engine/gc.h @@ -33,29 +33,24 @@ namespace Sci { -struct reg_t_EqualTo { - bool operator()(const reg_t& x, const reg_t& y) const { - return (x.segment == y.segment) && (x.offset == y.offset); - } -}; - struct reg_t_Hash { uint operator()(const reg_t& x) const { - return (x.segment << 3) | x.offset; + return (x.segment << 3) ^ x.offset ^ (x.offset << 16); } }; /* - * The reg_t_hash_map is actually really a hashset + * The AddrSet is a "set" of reg_t values. + * We don't have a HashSet type, so we abuse a HashMap for this. */ -typedef Common::HashMap<reg_t, bool, reg_t_Hash, reg_t_EqualTo> reg_t_hash_map; +typedef Common::HashMap<reg_t, bool, reg_t_Hash> AddrSet; /** * Finds all used references and normalises them to their memory addresses * @param s The state to gather all information from * @return A hash map containing entries for all used references */ -reg_t_hash_map *find_all_used_references(EngineState *s); +AddrSet *findAllActiveReferences(EngineState *s); /** * Runs garbage collection on the current system state |