Quantcast
Channel: Intel® C++-Compiler
Viewing all articles
Browse latest Browse all 1665

Variable / Object Initialization

$
0
0

When I declare and initialize objects with:

WCHAR MyString[1024] = {};

AStruct MyStructure = {};

 

The Intel compiler actually places a block of memory the size of the struct or array filled with '0' in the rdata section and copies the zeros into the object at run time... This behavior is bloating my compiled binary. 

 

The Microsoft compiler handles these initializations by doing a memset to zero on the new object. Is there a flag or option to have the Intel compiler use memset versus statically allocating the zeros and copying them on initialization?

 

Thanks!!


Viewing all articles
Browse latest Browse all 1665

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>