Russ Whitaker wrote:
How do you change the default size of the stack?
Borland has $M but couldn't find an equivalent in either gcc or gpc info pages. ( Perhaps I overlooked it )
For DJGPP, you can use something like this (or use stubedit):
{$ifdef DJGPP} const MinStackSize : Cardinal = $400000; asmname '_stklen'; {$endif}
On Unix-like systems, you can set a resource limit, but you don't do it in normal programs, but rather in the shell settings. (bash: ulimit; csh: limit; syscall: setrlimit(2))
DJGPP has to allocate the stack in physical memory at program startup, so one might have to be careful with too large stack limits. Most other systems allocate stack pages on demand, so the only reason to set a limit at all might be to prevent a runaway recursion from eating up all memory...
Frank