aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/segment.cpp
diff options
context:
space:
mode:
authormd52011-02-28 14:22:16 +0200
committermd52011-02-28 15:56:03 +0200
commit0d555c497d7208d0fa686f1b2369a52841873990 (patch)
tree41e30bc5bbe13f79e26b4f60e6192b3b3bc79d5b /engines/sci/engine/segment.cpp
parent9a60c58a8d1c91eb5731eaae0093b0ee4b68958f (diff)
downloadscummvm-rg350-0d555c497d7208d0fa686f1b2369a52841873990.tar.gz
scummvm-rg350-0d555c497d7208d0fa686f1b2369a52841873990.tar.bz2
scummvm-rg350-0d555c497d7208d0fa686f1b2369a52841873990.zip
SCI: Moved hunk pointer handling to the GC, and removed some related workarounds
SCI scripts can contain stale pointers, which are used later on. We now delete the contents of hunk entries without invalidating the relevant pointers and let the GC clear the references. Many thanks to waltervn and wjp for all their work and help on this.
Diffstat (limited to 'engines/sci/engine/segment.cpp')
-rw-r--r--engines/sci/engine/segment.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp
index 05d914cffb..d1f56f0da2 100644
--- a/engines/sci/engine/segment.cpp
+++ b/engines/sci/engine/segment.cpp
@@ -275,6 +275,11 @@ Common::Array<reg_t> DataStack::listAllOutgoingReferences(reg_t object) const {
}
+//-------------------- hunk ---------------------
+void HunkTable::freeAtAddress(SegManager *segMan, reg_t sub_addr) {
+ freeEntry(sub_addr.offset);
+}
+
//-------------------- lists --------------------
void ListTable::freeAtAddress(SegManager *segMan, reg_t sub_addr) {
freeEntry(sub_addr.offset);