[Scummvm-devel] ScummVM 0.12.0: Release status -- 2008-07-13

Kari Salminen kari.salminen at gmail.com
Wed Jul 16 14:40:36 CEST 2008


  Hello everyone,

[Talk about the BSS size]
> also cruise (380k), cine (100k) and others are using lots of data.
> Sometimes it's data tables we can't do anything about, but often
> it's an artifact of not fully OOified engines, which use global vars
> instead of class members (=allocated on heap).
>
> Cine:
> in texte.cpp
>   byte textTable[256][2][16 * 8]; (~64k}

  I looked into the Cine engine's BSS size related variables
and these global variables look like the prime candidates
(If I understood this BSS stuff correctly):

- anim.cpp (6630 bytes total for the listed variables here):
* 6630 bytes:
AnimData animDataTable[NUM_MAX_ANIMDATA]; // 255 elements
- object.cpp (7650 bytes total for the listed variables here):
* 7650 bytes:
objectStruct objectTable[NUM_MAX_OBJECT]; // 255 elements

- script_fw.cpp (2048 bytes total for the listed variables here):
* 2048 bytes
ScriptVars globalVars(NUM_MAX_VAR); // 256 elements

- texte.cpp (65536 bytes total for the listed variables here):
byte textTable[256][2][16 * 8];

- various.cpp (1024 bytes total for the listed variables here):
* 320 bytes
char commandBuffer[80];
char currentPrcName[20];
char currentRelName[20];
char currentObjectName[20];
char currentMsgName[20];
char newPrcName[20];
char newRelName[20];
char newObjectName[20];
char newMsgName[20];
char currentCtName[15];
char currentPartName[15];
char currentDatName[30];

* 600 bytes
static CommandeType currentSaveName[10]; // typedef char CommandeType[20];
CommandeType objectListCommand[20]; // typedef char CommandeType[20];

* 104 bytes
int16 objListTab[20];
uint16 zoneData[NUM_MAX_ZONE]; // #define NUM_MAX_ZONE 16
uint16 zoneQuery[NUM_MAX_ZONE]; // #define NUM_MAX_ZONE 16

So textTable in texte.cpp is the largest one (64kB) and then comes
~8kB for the objectTable in object.cpp and
~7kB for the animDataTable in anim.cpp.

I submitted a patch for reducing the BSS size of the Cine engine to
the patch tracker:
https://sourceforge.net/tracker/index.php?func=detail&aid=2019455&group_id=37116&atid=418822
and assigned it to Eugene for review,
so please Eugene, could you take a look at the patch when you've got time?

It only takes care of the textTable (64kB) reduction at the moment, but as it's
the biggest global array I think it's a good start.

Kari Salminen / Buddha^




More information about the Scummvm-devel mailing list