Contains druntime startup and shutdown routines.
Initialize druntime. If a C program wishes to call D code, and there's no D main(), then it must call rt_init() and rt_term().
Terminate use of druntime.
nothrow @nogc bool
isRuntimeInitialized();
Indicates whether druntime has been or is being initialized.
alias
TraceHandler = TraceInfo function(void* ptr);
Trace handler
void
rt_setTraceHandler(TraceHandler
h, Throwable.TraceDeallocator
d = null);
Overrides the default trace hander with a user-supplied version.
Parameters:TraceHandlerh | The new trace handler. Set to null to use the default handler. |
Throwable.TraceDeallocatord | The new dealloactor to use. |
TraceHandler
rt_getTraceHandler();
Return the current trace handler
Throwable.TraceInfo
_d_traceContext(void*
ptr = null);
This function will be called when an exception is constructed. The user-supplied trace handler will be called if one has been supplied, otherwise no trace will be generated.
Parameters:void*ptr | A pointer to the location from which to generate the trace, or null if the trace should be generated from within the trace handler itself. |
Returns:An object describing the current calling context or null if no handler is supplied.
Provide out-of-band access to the original C argc/argv passed to this program via main(argc,argv).
int
_d_run_main(int
argc, char**
argv, MainFunc
mainFunc);
Sets up the D char[][] command-line args, initializes druntime, runs embedded unittests and then runs the given D main() function, optionally catching and printing any unhandled exceptions.