the program int main() { new int[10000000](); } generates a 40MB executable. it compiles into a memcpy() of 40MB of zeros into the newly-allocated array. tested at -O0 and -O3. gcc version 4.0.1 20050727 (Red Hat 4.0.1-5)
-- Summary: default-initializing array new expression uses memcpy() instead of memset(), bloats executable Product: gcc Version: 4.0.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: avi at argo dot co dot il CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i386-redhat-linux GCC host triplet: i386-redhat-linux GCC target triplet: i386-redhat-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23477