diff options
author | Jordi Vilalta Prat | 2009-02-21 23:27:24 +0000 |
---|---|---|
committer | Jordi Vilalta Prat | 2009-02-21 23:27:24 +0000 |
commit | 817fde6cdddc700650e16018e9d6184ae29d1ecf (patch) | |
tree | 64379a245f082d7384bd45c015c8795a257d530c /engines/sci/engine/gc.cpp | |
parent | b5b4cb66a173bfea3792058e160f6b9a0b30e2ff (diff) | |
download | scummvm-rg350-817fde6cdddc700650e16018e9d6184ae29d1ecf.tar.gz scummvm-rg350-817fde6cdddc700650e16018e9d6184ae29d1ecf.tar.bz2 scummvm-rg350-817fde6cdddc700650e16018e9d6184ae29d1ecf.zip |
SCI: Convert the segment manager into a class
svn-id: r38767
Diffstat (limited to 'engines/sci/engine/gc.cpp')
-rw-r--r-- | engines/sci/engine/gc.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/engines/sci/engine/gc.cpp b/engines/sci/engine/gc.cpp index 0a0097aad5..94632a6b7c 100644 --- a/engines/sci/engine/gc.cpp +++ b/engines/sci/engine/gc.cpp @@ -100,11 +100,11 @@ static void free_worklist(worklist_t *wl) { } } -static reg_t_hash_map * normalise_hashmap_ptrs(reg_t_hash_map *nonnormal_map, seg_interface_t **interfaces, int interfaces_nr) { +static reg_t_hash_map * normalise_hashmap_ptrs(reg_t_hash_map *nonnormal_map, SegInterface **interfaces, int interfaces_nr) { reg_t_hash_map *normal_map = new reg_t_hash_map(); for (reg_t_hash_map::iterator i = nonnormal_map->begin(); i != nonnormal_map->end(); ++i) { - seg_interface_t *interfce; + SegInterface *interfce; reg_t reg = i->_key; interfce = (reg.segment < interfaces_nr) ? interfaces[reg.segment] : NULL; @@ -129,8 +129,8 @@ void add_outgoing_refs(void *pre_wm, reg_t addr) { } reg_t_hash_map *find_all_used_references(EngineState *s) { - SegManager *sm = &(s->seg_manager); - seg_interface_t **interfaces = (seg_interface_t**)sci_calloc(sizeof(seg_interface_t *), sm->heap_size); + SegManager *sm = s->seg_manager; + SegInterface **interfaces = (SegInterface **)sci_calloc(sizeof(SegInterface *), sm->heap_size); reg_t_hash_map *nonnormal_map = new reg_t_hash_map(); reg_t_hash_map *normal_map = NULL; worklist_t *worklist = new_worklist(); @@ -144,7 +144,7 @@ reg_t_hash_map *find_all_used_references(EngineState *s) { if (sm->heap[i] == NULL) interfaces[i] = NULL; else - interfaces[i] = get_seg_interface(sm, i); + interfaces[i] = sm->getSegInterface(i); // Initialise // Init: Registers @@ -229,7 +229,7 @@ reg_t_hash_map *find_all_used_references(EngineState *s) { } struct deallocator_t { - seg_interface_t *interfce; + SegInterface *interfce; #ifdef DEBUG_GC char *segnames[MEM_OBJ_MAX + 1]; int segcount[MEM_OBJ_MAX + 1]; @@ -255,7 +255,7 @@ void free_unless_used(void *pre_use_map, reg_t addr) { void run_gc(EngineState *s) { int seg_nr; deallocator_t deallocator; - SegManager *sm = &(s->seg_manager); + SegManager *sm = s->seg_manager; #ifdef DEBUG_GC c_segtable(s); @@ -267,7 +267,7 @@ void run_gc(EngineState *s) { for (seg_nr = 1; seg_nr < sm->heap_size; seg_nr++) { if (sm->heap[seg_nr] != NULL) { - deallocator.interfce = get_seg_interface(sm, seg_nr); + deallocator.interfce = sm->getSegInterface(seg_nr); #ifdef DEBUG_GC deallocator.segnames[deallocator.interfce->type_id] = deallocator.interfce->type; #endif |