Hi all
How does one increase the memory reserved for the stack in GPC programs on Linux? Thanks.
Best regards, The Chief --------- Prof. Abimbola Olowofoyeku (The African Chief) Author of Chief's Installer Pro for Win32 Email: African_Chief@bigfoot.com http://www.bigfoot.com/~african_chief/
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
On 23 Jul 01, at 10:00, Russell Whitaker wrote:
[...]
Asked that question some time ago. Frank's reply:
[...]
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))
I use bash, and ulimit only allows you to set the maximum stack size. What I need to be able to do is to set a minimum stack size. Does this mean that this cannot be done under Linux?
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) Author of: Chief's Installer Pro for Win32 http://www.bigfoot.com/~African_Chief/chief32.htm Email: African_Chief@bigfoot.com
Prof Abimbola Olowofoyeku wrote:
On 23 Jul 01, at 10:00, Russell Whitaker wrote:
[...]
Asked that question some time ago. Frank's reply:
[...]
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))
I use bash, and ulimit only allows you to set the maximum stack size. What I need to be able to do is to set a minimum stack size. Does this mean that this cannot be done under Linux?
Well, you can declare a big local variable and fill it with dummy data, so you make sure that some amount of stack it used. But that's quite pointless and probably not what you want.
If you're thinking of the minimum stack size in DJGPP, that's not necessary on most other systems (including Linux) as I said in the mail Russ quoted. The system will allocate stack pages when they are needed.
Russell Whitaker wrote:
Perhaps this should be added to the FAQ
Good idea. If you can make a diff against the current faq.texi, send it to Peter. Otherwise, I'll do it when I get around to it.
However, I'll be out of town until Aug 12. I'll probably read my mail more or less regularly, but only reply in urgent cases.
Frank