On 05/06/2013 05:46 AM, Florian Weimer wrote:
Nice, this is simpler than expected.  However, it makes the call sites
even more bloated.

Hmm, perhaps the checking should be wrapped in an inline function, so that the inliner can decide whether or not to expand it at the call site...

This patch also adds the type to libsupc++, and several exports to
libstdc++.

There's also overflow checking inside __cxa_vec_new[23].  At this point,
we don't know if the caller was compiled in C++11 mode.  But for C++03
code, throwing a subclass of std::bad_alloc probably won't hurt.

And we never use __cxa_vec_new* anyway, they're only there because the ABI requires them.

I noticed you use throw() in the declaration of
std::bad_array_new_length and _GLIBCXX_USE_NOEXCEPT in the definition,
which seems rather odd.  I'm surprised that this even compiles.

15.4 [except.spec]/3:

Two exception-specifications are compatible if:
— both are non-throwing (see below), regardless of their form
...

Jason

Reply via email to