Mail Archives: djgpp/2003/06/16/08:30:38
Ethan Rosenberg <ethros AT earthlink DOT net> wrote:
> Can you help??
> MUCH THANKS IN ADVANCE.
The problem, I think, is that you're blowing your stack by too many,
too large automatic arrays. I.e.:
[...]
> #define FFT_LEN 16384
[...]
> void stuff2(complx wave[])
> {
> int i,limit,j,jj;
> complx temp[FFT_LEN];
> complx temper6[FFT_LEN];
> complx temper7[FFT_LEN];
These are 3*16384*2*4 (or 8, if cmplx is made of doubles), or a total
of about 400K of stack memory usage. And they're not the only arrays
of this size your code uses, and which are all of storage class
"automatic".
Don't put such large objects on the stack. They should always be
allocated statically, or dynamically (using malloc() / new).
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -