| |||
| Home > ARM Compiler Reference > C and C++ implementation details > Using the ::operator new function | |||
In RVCT v2.0, when the ::operator new function
runs out of memory, it raises the signal SIGOUTOFHEAP,
instead of throwing a C++ exception. See Signal functions for more details.
In RVCT v2.1 ::operator new(std::size_t) throws
when memory allocation fails, in accordance with the ISO C++ Standard,
rather than raising a signal. If the exception is not caught, std::terminate() is
called. The compiler option --force_new_nothrow turns all
new calls in a compilation into calls to ::operator new(std::size_t, std::nothrow_t&) or :operator
new[](std::size_t, std::nothrow_t&). However, this does
not affect operator new calls in libraries, nor
calls to any class-specific operator new. It
is possible to install a new_handler which raises
a signal, to restore the RVCT v2.0 behavior.
See C++ Language configuration and object
generation for
a description of the --force_new_nothrow option.