Re: Minimum Stack Size

Jay Michael <[email protected]>
Newsgroups gmane.comp.compilers.gpc
Message-ID <[email protected]>
program t16( input, output ) ;

procedure recursive(i:integer);
begin
   if i<2000 then recursive(i+1);
end;

begin
recursive(0) ;
end.

     This completes for me.  (Windows XP, MinGW)
     The procedure uses 0x18 bytes of stack per call.

     If your procedure has local variables, that increases the size of its stack frame.
     If your procedure has an argument that is a structure or array that is being passed by value, the compiler will be making a copy in the stack frame of the current invocation before calling the next level.

     You can use "gdb" to look at the first few instructions of your procedure.
     I think if you compile with a "-S" option, you will have an assembly language source file to look at.

_______________________________________________
Gpc mailing list
[email protected]
https://www.g-n-u.de/mailman/listinfo/gpc
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.