Static data area?

Is there a separate area that holds static data?

Reason I ask is I recently made an optimization that traded off reducing code space for (what I presumed) increasing data usage. I made a table of data and had a small routine iterate on it all. It let me cut out a bunch of redundant code. (This is for the water propagation in Terrarium, if you’re interested.)

I saved about 300 bytes of code space, which was awesome! I was expecting my data table to increase my data footprint, but it didn’t. It had no effect.

Since that section is called “dynamic” in the compile output I’m guessing my table of static/constant data is being put somewhere else.

Can anyone enlighten me on what’s going on and how much room I might have for static data?

1 Like

It could depend on how the data table is allocated. If it is on the stack, then it will not show up in the dynamic section, and the only way you will know that you used too much is that you will blow the stack.

Can you post some code snippets and we’ll try to figure it out?

1 Like