From: firewind Newsgroups: comp.os.msdos.djgpp Subject: Re: Large arrays eating disk space Date: 12 Oct 1997 18:16:09 GMT Organization: Netcom Lines: 33 Message-ID: <61r459$dkh@sjx-ixn4.ix.netcom.com> References: NNTP-Posting-Host: elp-tx2-16.ix.netcom.com Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk J. Hormuzdiar wrote: > Hello- > Perhaps this question is better intended for comp.lang.c, but I am > not sure yet. It is not on-topic for comp.lang.c; how a compiler stores fixed-length arrays has nothing to do with the C language. > I am using a djgpp/rhide environment with a program that has some > huge fixed size arrays. When I compile I get an executable that is > correspondingly huge (many meg's), even though the code is pretty small. > I assume that the compiler is saving the whole huge blank pre-used array > in the executable, and I wish it wouldn't. The space is a problem, but > even worse is the wait for the compiler to save the huge thing every time. > I could just dynamically allocate using malloc, but I seem to > remember that there is a keyword or option that will automatically do it > for me. Perhaps I could just add a word to the declaration- > (word) float x[7000][7000]; If you are using C++ and are delcaring the array 'static,' adding the switch '-fconserve-space' can help out, as described in the DJGPP FAQ, section 8.14. Otherwise, I see no solution save dynamic allocation. late\fw -- [- firewind -] [- email: firewind AT metroid DOT dyn DOT ml DOT org (home), firewind AT aurdev DOT com (work) -] [- "You're just jealous because the voices talk to -me-." -] [- Have a good day, and enjoy your C. -]