From 5c504739bd16b4a3eecd57b117010baad0d3ef1d Mon Sep 17 00:00:00 2001 From: md5 Date: Wed, 9 Mar 2011 23:33:26 +0200 Subject: SCI: Removed unnecessary parameter from deallocate() --- engines/sci/engine/seg_manager.cpp | 13 ++++++------- engines/sci/engine/seg_manager.h | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'engines/sci/engine') diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp index c75ceab280..2be3184b59 100644 --- a/engines/sci/engine/seg_manager.cpp +++ b/engines/sci/engine/seg_manager.cpp @@ -63,7 +63,7 @@ void SegManager::resetSegMan() { // Free memory for (uint i = 0; i < _heap.size(); i++) { if (_heap[i]) - deallocate(i, false); + deallocate(i); } _heap.clear(); @@ -151,7 +151,7 @@ Script *SegManager::allocateScript(int script_nr, SegmentId *segid) { return (Script *)mem; } -void SegManager::deallocate(SegmentId seg, bool recursive) { +void SegManager::deallocate(SegmentId seg) { VERIFY(check(seg), "invalid seg id"); SegmentObj *mobj = _heap[seg]; @@ -159,8 +159,8 @@ void SegManager::deallocate(SegmentId seg, bool recursive) { if (mobj->getType() == SEG_TYPE_SCRIPT) { Script *scr = (Script *)mobj; _scriptSegMap.erase(scr->getScriptNumber()); - if (recursive && scr->_localsSegment) - deallocate(scr->_localsSegment, recursive); + if (scr->_localsSegment) + deallocate(scr->_localsSegment); } delete mobj; @@ -176,8 +176,7 @@ bool SegManager::isHeapObject(reg_t pos) const { } void SegManager::deallocateScript(int script_nr) { - SegmentId seg = getScriptSegment(script_nr); - deallocate(seg, true); + deallocate(getScriptSegment(script_nr)); } Script *SegManager::getScript(const SegmentId seg) { @@ -864,7 +863,7 @@ bool SegManager::freeDynmem(reg_t addr) { if (addr.segment < 1 || addr.segment >= _heap.size() || !_heap[addr.segment] || _heap[addr.segment]->getType() != SEG_TYPE_DYNMEM) return false; // error - deallocate(addr.segment, true); + deallocate(addr.segment); return true; // OK } diff --git a/engines/sci/engine/seg_manager.h b/engines/sci/engine/seg_manager.h index 61fa2e2245..58c88ca870 100644 --- a/engines/sci/engine/seg_manager.h +++ b/engines/sci/engine/seg_manager.h @@ -477,7 +477,7 @@ private: private: SegmentObj *allocSegment(SegmentObj *mem, SegmentId *segid); - void deallocate(SegmentId seg, bool recursive); + void deallocate(SegmentId seg); void createClassTable(); SegmentId findFreeSegment() const; -- cgit v1.2.3