Re: Stack size
Re: Stack size
- Subject: Re: Stack size
- From: "Sven A. Schmidt" <email@hidden>
- Date: Thu, 27 Dec 2001 11:28:39 +0100
On Donnerstag, Dezember 27, 2001, at 01:39 Uhr, Hampus Edvardsson wrote:
I am trying to build and run a program that needs to allocate 512 kB on
the stack (by doing: int data[512*256];). The code compiles but when I
run it, it gets a EXC_BAD_ACCESS signal and dies.
I found out that the reason this happens is because the default maximum
stack size is set to 512 kbytes, and that that value could be changed
in tcsh with the command "limit stacksize 8192". After giving that
command the application runs fine when started from the same terminal.
Is there any way to specify the maximum stack size inside the
application, so it will run when started from the finder?
How about a little shell wrapper that you call in both cases?
#!/bin/tcsh
limit stacksize 8192
your_app
Sven
References: | |
| >Stack size (From: Hampus Edvardsson <email@hidden>) |