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

neil at millstone.demon.co.uk neil at millstone.demon.co.uk
Wed Sep 9 11:04:34 CEST 2009


Hi Max,

I will give this a go some time in the next week. Thanks for looking at this. Although the game appeared to be ok with my fix, more memory is always useful, so hopefully it will be a while before I have to scrape around for some more ram in the saga engine.

Thanks,

- Neil



-- Original message --
From: Max Horn


Ping? Anybody able to test the change described below, so that it can  
be backported to the 1.0.0 branch ? Or are all SAGA memory problems  
resolved for the DS port anyway?

Bye,
Max

Am 03.09.2009 um 20:57 schrieb Max Horn:

>
> 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
>





-----------------------------------------
Sent by emoze push mail





More information about the Scummvm-devel mailing list