[Scummvm-devel] SAGA memory savings Was: ScummVM 1.0.0: Release status 2009-08-11 -- Full feature, freeze

Max Horn max at quendi.de
Thu Sep 3 20:57:23 CEST 2009


Am 02.09.2009 um 21:33 schrieb Max Horn:

>
> Am 16.08.2009 um 03:41 schrieb Neil Millstone:
> [...]
>
>>
>> I was looking at the Saga memory usage again today.  By poking around
>> stack dumps when it crashed, I tracked down the ~200Kb alloc which
>> makes
>> the game crash to the path finder in Actor::fillPathArray().  This
>> function sometimes causes a 16384 element Common::Array of
>> PathDirectionData to be created while it is in operation.  This
>> comes to
>> 196608 bytes.
>
> I commited a change (rev 43912) which changes the array to a queue
> (using Common::List instead of Common::Array), and now removes
> elements that are not needed anymore. While that has a somewhat higher
> overhead per element, the result is that the maximal size of the
> collection during the chess (intro) scene in ITE shrinks from over
> 10,000 down to 110-250. That *should* save another 100kb or so, but I
> didn't measure it precisely. Hopefully it helps anyway :).
>
> Yay for basic computer science knowledge :). A pity so many coders
> (e.g. the original SAGA authors, it seems?) lack it or don't apply  
> it :
> (.
>

To clarify that: My change went only to trunk, and received only light  
testing. Nevertheless I am convinced that it is save... So if somebody  
could test it some more, it might be a good idea to backport it to the  
branch.

Cheers,
Max




More information about the Scummvm-devel mailing list