[Scummvm-devel] Memory footprint

Torbjörn Andersson eriktorbjorn at telia.com
Mon Jan 15 06:23:56 CET 2007


Max Horn wrote:

> One idea I had: Maybe one can safe 300-700k in NutRenderer::loadFont
> (well, for CoMI, at least), by not pre-decoding the fonts, but rather
> decoding the compressed data on the fly (i.e. load the font file to
> memory, don't unpack it, but rather use it on the fly).

It looks to me as if the total number of bytes allocated for the decoded
characters is actually smaller than the length of the uncompressed font
data.

On the other hand, I guess there's a certain amount of bookkeeping
information for the memory allocator to keep track of such a large
number of tiny memory blocks, so maybe it's a good idea to allocate just
one block for all the decoded data instead? I'll see if I can get that
to work, and you can check if it makes any difference.

Another simple thing would be to change the xoffs, yoffs, width and
height that we store for each character from int to int16.

Torbjörn




More information about the Scummvm-devel mailing list