Re:Re: stack overflow
Here are two descriptions. They both say the same thing. Pick
whichever works best for you.
A new one:
---------------
If you place a normal declaration of something within a function, and
a constructor IS a function, then it is an automatic variable.
Automatic variables are allocated from the stack.
If the declarations are placed where you say, in the constructor of
TForm then their over 7 Megabyte allocation size exceeds that of the 2
Megabyte stack.
The size of the allocation is the source of the a stack overflow.
This problem is not in the compiler. This problem is in the way the
program is written.
---------------
The one from my previous message to which you replied:
---------------
The error suggests that the class instance is allocated as an
automatic variable within a function. Automatic variables are
allocated from the stack.
Windows defaults to providing a huge, 2 Meg stack for each program.
Your single class instance is about 7 Meg. Either do not allocate it
as an automatic variable or set the linker options to have a larger
stack and pray that Windows lets you have the size you requested.
---------------
. Ed
Quote
Jonathan Benedicto wrote in message
news:4288d17e$ XXXX@XXXXX.COM ...
I don't think that I was very clear with how to recreate the error.
Create a new BCB application, and then in the constructor of TForm1,
place this:
std::string t1[6][46656];
long double t2[7][1040][7];
Now run it, and it should give you a overflow.