Runtime

This struct encapsulates all functionality related to the underlying runtime module for the calling context.

Members

Properties

args
string[] args [@property getter]

Returns the arguments supplied when the process was started.

cArgs
CArgs cArgs [@property getter]

Returns the unprocessed C arguments supplied when the process was started. Use this when you need to supply argc and argv to C libraries.

collectHandler
CollectHandler collectHandler [@property setter]

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.

collectHandler
CollectHandler collectHandler [@property getter]

Gets the current collect handler.

extendedModuleUnitTester
ExtendedModuleUnitTester extendedModuleUnitTester [@property setter]

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 tests ran without error.

extendedModuleUnitTester
ExtendedModuleUnitTester extendedModuleUnitTester [@property getter]

Gets the current module unit tester.

moduleUnitTester
ModuleUnitTester moduleUnitTester [@property setter]

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 tests ran without error.

moduleUnitTester
ModuleUnitTester moduleUnitTester [@property getter]

Gets the current legacy module unit tester.

traceDeallocator
Throwable.TraceDeallocator traceDeallocator [@property getter]

Gets the current trace deallocator.

traceHandler
void traceHandler(TraceHandler h, Throwable.TraceDeallocator d)

Overrides the default trace mechanism with a 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.

traceHandler
TraceHandler traceHandler [@property getter]

Gets the current trace handler.

Static functions

initialize
bool initialize()

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. If the runtime was already successfully initialized this returns true. Each call to initialize must be paired by a call to terminate.

loadLibrary
void* loadLibrary(char[] name)

Locates a dynamic library with the supplied library name and dynamically loads it into the caller's address space. If the library contains a D runtime it will be integrated with the current runtime.

terminate
bool terminate()

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. If the runtime was not successfully initialized the function returns false.

unloadLibrary
bool unloadLibrary(void* p)

Unloads the dynamic library referenced by p. If this library contains a D runtime then any necessary finalization or cleanup of that runtime will be performed.

Meta