From: "Tony O'Bryan" Newsgroups: comp.os.msdos.djgpp Subject: Re: Excessive exe sizes Date: Tue, 25 Nov 1997 06:35:31 -0600 Organization: Southwest Missouri State University Lines: 14 Message-ID: <347AC613.5046@nic.smsu.edu> References: <199711250232 DOT VAA28286 AT delorie DOT com> Reply-To: aho450s AT nic DOT smsu DOT edu NNTP-Posting-Host: sara.a04.smsu.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk sl wrote: > That is the dumbest thing I have ever heard. You are allocating MEMORY here, not diskspace! > Regardless of if you allocate the array staticly or dynamically it should NOT use up diskspace! That depends on the situation, of course. For allocating arrays that are auto-initialized, how else is the program to know what values the array should have at startup? Have the program code fill the array at run-time? That takes much more disk space to write the code overhead. The only optimization in this case (that I can think of) is to have gcc check if the array is hard coded to autoinitialize to all zeros. If so, then the startup code could be generated to run a small loop to write zeros to all locations. That case would eliminate disk bloat for large global arrays.