www.digitalmars.com         C & C++   DMDScript  

D - [BUG] Where is the stack size limit defined?

reply Manfred Nowak <svv1999 hotmail.com> writes:
WinXP, dmd 0.82

<code>
void okay(){
  int[259013] arr;
}
void err(){
  int[259014] arr;
}
void main(char[][] args){
  if( args.length > 1)
   switch( args[ 1]){
    case "okay": okay();
      break;
    case "err": err();
      break;
   }
}
</code>

Gives a runtime error on call with parameter "err" and runs okay with
parameter "okay".

Where is this limit defined? Why are these unused arrays not optimized
away? With -O switch also the "okay"-case yields a runtime error.

So long!
Apr 18 2004
parent "Walter" <walter digitalmars.com> writes:
"Manfred Nowak" <svv1999 hotmail.com> wrote in message
news:c5v49l$jpr$1 digitaldaemon.com...
 WinXP, dmd 0.82

 <code>
 void okay(){
   int[259013] arr;
 }
 void err(){
   int[259014] arr;
 }
 void main(char[][] args){
   if( args.length > 1)
    switch( args[ 1]){
     case "okay": okay();
       break;
     case "err": err();
       break;
    }
 }
 </code>

 Gives a runtime error on call with parameter "err" and runs okay with
 parameter "okay".

 Where is this limit defined?
See www.digitalmars.com/ctg/ctgDefFiles.html#stacksize
 Why are these unused arrays not optimized
 away? With -O switch also the "okay"-case yields a runtime error.

 So long!
Apr 18 2004