Function etc.linux.memoryerror.registerMemoryAssertHandler
Registers a signal handler for SIGSEGV that turns them into an assertion failure, providing a more descriptive error message and stack trace if the program is compiled with debug info and D assertions (as opposed to C assertions).
bool registerMemoryAssertHandler();
Differences with the registerMemoryErrorHandler version are:
- The handler is registered with SA_ONSTACK, so it can handle stack overflows.
- It uses assert(0) instead of throw new Error and doesn't support catching the error.
- This is a template so that the -check and -checkaction flags of the compiled program are used,
instead of the ones used for compiling druntime.
Returns
whether the registration was successful
Authors
Amaury SECHET, FeepingCreature, Vladimir Panteleev
License
Distributed under the Boost Software License 1.0. (See accompanying file LICENSE_1_0.txt)