The runtime module exposes information specific to the D runtime code.
Sean Kelly
- struct Runtime ¶
-
This struct encapsulates all functionality related to the underlying runtime
module for the calling context.
- bool initialize(void delegate(Exception) dg = null) [static] ¶
-
Initializes the runtime. This call is to be used in instances where the
standard program initialization process is not executed. This is most
often in shared libraries or in libraries linked to a C program.
dg | A delegate which will receive any exception thrown during the
initialization process or null if such exceptions should be
discarded. |
true if initialization succeeds and false if initialization fails.
- bool terminate(void delegate(Exception) dg = null) [static] ¶
-
Terminates the runtime. This call is to be used in instances where the
standard program termination process will not be not executed. This is
most often in shared libraries or in libraries linked to a C program.
dg | A delegate which will receive any exception thrown during the
termination process or null if such exceptions should be
discarded. |
true if termination succeeds and false if termination fails.
- void traceHandler(TraceHandler h) [@property, static] ¶
-
Overrides the default trace mechanism with s user-supplied version. A
trace represents the context from which an exception was thrown, and the
trace handler will be called when this occurs. The pointer supplied to
this routine indicates the base address from which tracing should occur.
If the supplied pointer is null then the trace routine should determine
an appropriate calling context from which to begin the trace.
h | The new trace handler. Set to null to use the default handler. |
- void collectHandler(CollectHandler h) [@property, static] ¶
-
Overrides the default collect hander with a user-supplied version. This
routine will be called for each resource object that is finalized in a
non-deterministic manner--typically during a garbage collection cycle.
If the supplied routine returns true then the object's dtor will called
as normal, but if the routine returns false than the dtor will not be
called. The default behavior is for all object dtors to be called.
h | The new collect handler. Set to null to use the default handler. |
- void moduleUnitTester(ModuleUnitTester h) [@property, static] ¶
-
Overrides the default module unit tester with a user-supplied version.
This routine will be called once on program initialization. The return
value of this routine indicates to the runtime whether the body of the
program will be executed.
h | The new unit tester. Set to null to use the default unit tester. |
- bool runModuleUnitTests() [extern(C)] ¶
-
This routine is called by the runtime to run module unit tests on startup.
The user-supplied unit tester will be called if one has been supplied,
otherwise all unit tests will be run in sequence.
true if execution should continue after testing is complete and false if
not. Default behavior is to return true.