Hi!
We're using an MSP430F2618 in an embedded application. We're using Codecomposer v4.1.2.00027, and we happend to notice some strange behavour with regards to the resulting binary size when compling with "large data model" enabled.
Example:
main.cpp:
#include <map>
using namespace std;
int main()
{
deque<int> *myDeque = new deque<int>();
int i = 0;
myDeque->push_back(i++);
myDeque->push_back(i++);
myDeque->push_back(i++);
myDeque->push_back(i++);
myDeque->push_back(i++);
myDeque->push_back(i++);
myDeque->push_back(i++);
myDeque->push_back(i++);
myDeque->push_back(i++);
myDeque->push_back(i++);
myDeque->push_back(i++);
myDeque->push_back(i++);
myDeque->push_back(i++);
myDeque->push_back(i++);
myDeque->push_back(i++);
myDeque->push_back(i++);
myDeque->push_back(i++);
myDeque->push_back(i++);
myDeque->push_back(i++);
myDeque->push_back(i++);
}
In a default release build (i.e "large data model" disabled), this results in a 7.6kB binary loaded into flash. Compiling with "large data model" enabled, the same code results in a 12.4kB binary loaded into flash. Is this suppose to happen?
If so, our application is quite large (way beond 65kB), and depend on having "large data model" enabled. What can be done to decrease the binary size, are there any options we can enable/disable?
Having a look at the resulting *.map file for the compiling with "large data model" enabled, it seems like (at least in the map-file for our application) that each call to any function in STL deque is getting it's own version of that function in the binary, i.e. any new calls to a deque funcions is not reusing the previous one in the binary.