
17 May
2009
17 May
'09
10:10 a.m.
GCC allocates exceptions on the heap. If that fails, it will allocate them in the emergency storage instead. The emergency storage is a small
MSVC allocates on the stack.
I am a bit surprised. During compilation it can be checked what is the maximal size of exception being thrown and preallocate space for it (or maybe two such to handle throwing from within catch). This way exception propagation will always succeed unless user uses new during exception construction (like with Boost.Exception data injection). But this is done by the user himself/herself so it is up to his/her control and choice. Adam Badura