Re: Increasing your app's stack size
Re: Increasing your app's stack size
- Subject: Re: Increasing your app's stack size
- From: "Michael Crawford" <email@hidden>
- Date: Wed, 19 Sep 2007 13:35:05 -0700
Hi,
I don't know how you can increase stack size, but there are a couple
ways to reduce stack usage:
Look at all the functions that are in the stack at the time of the
crash to see if any local variables are large. Consider allocating
them from the heap instead of the stack.
If you don't want to do that, consider breaking up longer functions
into several shorter ones, so that some of the new functions are
called, use the stack but then immediately return. This way the large
variables don't have to be on the stack when the deep call chain is
made.
If you're using a recursive function, consider converting it to an
iterative one that keeps its state in a stack structure that you
allocate. Sedgewick's Algorithms book, at least the first edition,
gives an example of this.
Mike
On 9/19/07, Mark Thomas <email@hidden> wrote:
> Hi All,
> Was wonder if somebody could help with this as I think I have some code
> which is running out of stack space and is around 190 frames down and
> crashes in CoreService framework API call, but using a different path with
> using less stack frames seems to work. So has made me wonder if I'm running
> out of stack stack here in 190 case.
>
> So using info from
>
> http://developer.apple.com/qa/qa2005/qa1419.html
>
> and then adding -stack_size 1000000, seems to cause a linker error of not
> knowing "stack_size" has this changed ?
>
> Thanks
> Mark.
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
--
Michael David Crawford
mdcrawford at gmail dot com
Enjoy my art, photography, music and writing at
http://www.geometricvisions.com/
--- Free Music Downloads ---
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden