Re: Running out of memory on stack in C++ routine invoked within Cocoa NSOperation
Re: Running out of memory on stack in C++ routine invoked within Cocoa NSOperation
- Subject: Re: Running out of memory on stack in C++ routine invoked within Cocoa NSOperation
- From: Greg Parker <email@hidden>
- Date: Wed, 18 Feb 2009 12:17:22 -0800
On Feb 18, 2009, at 3:22 AM, Michael Vannorsdel wrote:
Really it would be best to malloc the space, use it, and free it.
Once you get to huge stack usage you gamble that you won't run out
when there can be other higher up calls also consuming some
(frameworks, libs, 3rd party code, ect). Also if you only use the
large amount once in a while then you have a bunch of unutilized
memory sitting around.
Agreed: use malloc for large memory allocations.
One other limit that you apparently haven't run into yet: some
architectures limit the maximum size of a single stack frame, even if
there is lots of space on the stack. ppc has a maximum 64K stack frame
size; arm may have a similar limit.
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden