By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,966 Members | 1,463 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,966 IT Pros & Developers. It's quick & easy.

stack allocation error

P: n/a
Operator new() must throw std::bad_alloc in no more dynamical memory
left, but what standard says about stack?

Is there a some way to handle stack overflow?

Raider
May 2 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Raider wrote:
Operator new() must throw std::bad_alloc in no more dynamical memory
left, but what standard says about stack?

Is there a some way to handle stack overflow?


Not in the Standard language/library. See your compiler documentation.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
May 2 '06 #2

P: n/a
Raider wrote:
Operator new() must throw std::bad_alloc in no more dynamical memory
left, but what standard says about stack?

Is there a some way to handle stack overflow?


The Standard says nothing about stacks (except of course for
std::stack, but I digress). If your platform does something about stack
overflows, it is implementation-dependent. <OT>I think Microsoft
platforms might throw a "structured exception", which you can handle
with a catch(...) or their __try/__except/__finally keywords. (See
http://www.boost.org/more/error_handling.html for some discussion and
helpful hints on structured exceptions interacting with standard
C++.)</OT>

Cheers! --M

May 2 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.