diff options
author | Filippos Karapetis | 2009-08-25 08:38:14 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-08-25 08:38:14 +0000 |
commit | ed66cad6777a779f5cabeec037a24613da0134bf (patch) | |
tree | a63032758b32e3ada2ec0287033edfc5a17ee1c3 /engines/sci/engine/gc.cpp | |
parent | bc20237ae37cf042a0f7c2c49cd0ca68ef76379b (diff) | |
download | scummvm-rg350-ed66cad6777a779f5cabeec037a24613da0134bf.tar.gz scummvm-rg350-ed66cad6777a779f5cabeec037a24613da0134bf.tar.bz2 scummvm-rg350-ed66cad6777a779f5cabeec037a24613da0134bf.zip |
- Simplified the parameters of some functions
- Replaced some EngineState parameters
- The SCI version is now obtained from the resource manager or the segment manager, thereby simplifying several functions
- Plugged 2 leaks in the fallback detector
- Renamed the segment manager and resource manager to "segmentManager" and "resourceManager" in all places, for consistency
svn-id: r43722
Diffstat (limited to 'engines/sci/engine/gc.cpp')
-rw-r--r-- | engines/sci/engine/gc.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/sci/engine/gc.cpp b/engines/sci/engine/gc.cpp index 63a20ddf25..41d454d637 100644 --- a/engines/sci/engine/gc.cpp +++ b/engines/sci/engine/gc.cpp @@ -71,7 +71,7 @@ void add_outgoing_refs(void *refcon, reg_t addr) { } reg_t_hash_map *find_all_used_references(EngineState *s) { - SegManager *sm = s->seg_manager; + SegManager *sm = s->segmentManager; reg_t_hash_map *normal_map = NULL; WorklistManager wm; uint i; @@ -134,7 +134,7 @@ reg_t_hash_map *find_all_used_references(EngineState *s) { if (reg.segment != s->stack_segment) { // No need to repeat this one debugC(2, kDebugLevelGC, "[GC] Checking %04x:%04x\n", PRINT_REG(reg)); if (reg.segment < sm->_heap.size() && sm->_heap[reg.segment]) - sm->_heap[reg.segment]->listAllOutgoingReferences(s, reg, &wm, add_outgoing_refs); + sm->_heap[reg.segment]->listAllOutgoingReferences(reg, &wm, add_outgoing_refs, s->resourceManager->sciVersion()); } } @@ -145,7 +145,7 @@ reg_t_hash_map *find_all_used_references(EngineState *s) { } struct deallocator_t { - SegManager *segmgr; + SegManager *segManager; MemObject *mobj; #ifdef DEBUG_GC char *segnames[MEM_OBJ_MAX + 1]; @@ -160,7 +160,7 @@ void free_unless_used(void *refcon, reg_t addr) { if (!use_map->contains(addr)) { // Not found -> we can free it - deallocator->mobj->freeAtAddress(deallocator->segmgr, addr); + deallocator->mobj->freeAtAddress(deallocator->segManager, addr); #ifdef DEBUG_GC debugC(2, kDebugLevelGC, "[GC] Deallocating %04x:%04x\n", PRINT_REG(addr)); deallocator->segcount[deallocator->mobj->getType()]++; @@ -172,14 +172,14 @@ void free_unless_used(void *refcon, reg_t addr) { void run_gc(EngineState *s) { uint seg_nr; deallocator_t deallocator; - SegManager *sm = s->seg_manager; + SegManager *sm = s->segmentManager; #ifdef DEBUG_GC debugC(2, kDebugLevelGC, "[GC] Running...\n"); memset(&(deallocator.segcount), 0, sizeof(int) * (MEM_OBJ_MAX + 1)); #endif - deallocator.segmgr = sm; + deallocator.segManager = sm; deallocator.use_map = find_all_used_references(s); for (seg_nr = 1; seg_nr < sm->_heap.size(); seg_nr++) { |