View source code
Display the source code in core/runtime.d from which this
page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a
Bugzilla 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 using
local clone.
Struct core.runtime.Runtime
This struct encapsulates all functionality related to the underlying runtime module for the calling context.
struct Runtime
;
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. |
extendedModuleUnitTester [set]
|
UnitTestResult 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 [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. |
traceHandler [set]
|
object | 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. |
Methods
Name | Description |
---|---|
collectHandler
()
|
Gets the current collect handler. |
extendedModuleUnitTester
()
|
Gets the current module unit tester. |
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
(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. |
moduleUnitTester
()
|
Gets the current legacy module unit tester. |
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. |
traceDeallocator
()
|
Gets the current trace deallocator. |
traceHandler
()
|
Gets the current trace handler. |
unloadLibrary
(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. |
Authors
Sean Kelly
License
Copyright © 1999-2024 by the D Language Foundation | Page generated by ddox.