Mail Archives: djgpp/1997/10/12/15:16:03
J. Hormuzdiar <jimh AT pantheon DOT yale DOT edu> 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. -]
- Raw text -