I have a simulink model with a c++ SFunction I would like to send a large nested bus into, however the compiler crashes after about ten minutes with a lack of heap space error.
The bus has nine buses inside it and a further set of buses inside those, a total of 49 buses and 490 signals in a tree. I have generated the full bus definition and they are all in the global workspace. I have generated also the full structure definition in a header file, with each of the 49 buses using the header.
The automatically generated source for this SFunction is approximately 24000 lines.
Compiling this SFunction fails after a long time, complaining of insufficient heap space on pass 2. I am using the compiler shipped with Visual C++ 2010 Express.
I have experimented by filling the bus with elements one by one, and seen a nearly exponential growth in compile time to the point of failure. Why should the performance be so poor and is there a way to compile with a bus of this size?