Community
SCI Programming => SCI Syntax Help => Topic started by: gumby on January 02, 2021, 01:26:44 PM
-
I'm working on an SCI1.1 game and I'm running out of heap. In my testing I tried using DosBox and ScummVM and I found that upon starting up the game and immediately going into the debugger and viewing the available heap (alt-d, alt-r) there are differences.
In DosBox, I have 10040 bytes free. In ScummVM, I have 32746 bytes free. Does someone here have an explanation as to why this would be?
-
If I recall correctly, in ScummVM each script has its own 64KB segment on the heap, and any new objects you create are put on a separate 64KB segment too. So I don't think you can tell too much from asking how much free heap there is in ScummVM.
-
And actually it looks like ScummVM just returns a hardcoded number:
https://github.com/scummvm/scummvm/blob/4a7248627906ca34a45118d65bd0e51656f6421c/engines/sci/engine/kmisc.cpp
0x7fea (or decimal 32746)
-
If I recall correctly, in ScummVM each script has its own 64KB segment on the heap, and any new objects you create are put on a separate 64KB segment too. So I don't think you can tell too much from asking how much free heap there is in ScummVM.
So it sounds like for my circumstance, I'm better off using ScummVM because it's doing memory management differently? Which would potentially result in less 'Out of Heap' errors?
-
So far the out of heap errors are only happening while playing/testing with DosBox, ScummVM doesn't exhibit the same issues.
I'm sure I've got some more due-diligence to do with heap management - I have added additional scripts into the DisposeCode.sc which has improved things somewhat.