View source code Display the source code in core/runtime.d from which this page was generated on github. 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 using local clone. Page wiki View or edit the community-maintained wiki page associated with this page.

Struct core.runtime.Runtime

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

Properties

Name Type Description
args [get] string[] Returns the arguments supplied when the process was started.
cArgs [get] CArgs 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 [set] bool function(Object) 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 [set] bool Gets the current collect handler.
moduleUnitTester [set] bool function() 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 [get] bool Gets the current module unit tester.
traceHandler [set] object.Throwable.TraceInfo function(void*) 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 [set] object.Throwable.TraceInfo Gets the current trace handler.

Methods

Name Description
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 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 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 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.

Authors

Sean Kelly

License

Boost License 1.0

Comments