View source code
Display the source code in etc/linux/memoryerror.d from which thispage was generated on github.
Report a bug
If you spot a problem with this page, click here to create aBugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.Requires a signed-in GitHub account. This works well for small changes.If you'd like to make larger changes you may want to consider usinglocal clone.

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)