Guest
#2986768
Hello,
Please help me understand how the compiler does the flowing
optimization:
I have an array of strings (pointers to char) declared this way:
const char* const STR_ARRAY[] =
{
"first",
"second",
"third",
"fourth",
"fifth",
... and so on ..
"last"
}
After compiling, I fond in the .map file the memory zone where the
string where saved and I was surprised to see that some optimization was
made.
.rodata.str1.1
0x01055586 0x1af3 .myStrArray.o
0x2060 (size before relaxing)
The actual size of my strings is 0x2061 (all the letters + the null
terminator for each string), but only 0x1af3 bytes used..
Thank you,
Andrew