[Scummvm-devel] _maxHeapThreshold, the saga continues

Marcus Comstedt marcus at mc.pp.se
Sun May 4 07:12:22 CEST 2003


Oh well.

Playtesting The Dig some more, I quickly ran across some rooms where
1500000 is too low a threshold as well.

Location            _allocatedSize after expireResources
---------------     ----------------------------------------
Outside wreck       1680409
Clearing            1775868
Dais                2258614
Cave-in room        1969078

For now, I increased the NEW_COSTUMES threshold from 1500000 to
2500000.

This kind of tuning doesn't feel very comfortable though, so my
suggestion for the future is to have the threshold automatically
adjusted whenever it is discovered that it is set to low.  I think
this would be very simple to accomplish, just add the following at the
very end of expireResources():

 if( size+_allocatedSize > _maxHeapThreshold-margin )
    _maxHeapThreshold = size+_allocatedSize+margin;

where margin is something like 64K, to keep it from flushing out the
scripts, or whatever expirable resources there might exist in the
room.

Good?  For 0.4.0 or for later?


  // Marcus






More information about the Scummvm-devel mailing list