On Mon, 23 Jul 2001, Prof. A Olowofoyeku (The African Chief) wrote:
How does one increase the memory reserved for the stack in GPC programs on Linux? Thanks.
Asked that question some time ago. Frank's reply:
Date: Fri, 26 Jan 2001 06:04:07 +0100 From: Frank Heckenbach frank@g-n-u.de To: gpc@gnu.de Subject: Re: Stack problems?
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