Movatterモバイル変換


[0]ホーム

URL:


D Logo
Menu
Search

Library Reference

version 2.112.0

overview

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 usinga local clone.

rt.config

Configuration options for druntime.
The default way to configure the runtime is by passing command line argumentsstarting with--DRT- and followed by the option name, e.g.--DRT-gcopt toconfigure the GC.When command line parsing is enabled, command line options startingwith--DRT- are filtered out before calling main, so the programwill not see them. They are still available viart_args().
Configuration via the command line can be disabled by declaring a variable for thelinker to pick up before using it's default from the runtime:
extern(C)__gsharedbool rt_cmdline_enabled =false;
Likewise, declare a boolean rt_envvars_enabled to enable configuration via theenvironment variableDRT_ followed by the option name, e.g.DRT_GCOPT:
extern(C)__gsharedbool rt_envvars_enabled =true;
Setting default configuration properties in the executable can be done by specifying anarray of options namedrt_options:
extern(C)__gshared string[] rt_options = ["gcopt=precise:1 profile:1"];
Evaluation order of options isrt_options, then environment variables, then commandline arguments, i.e. if command line arguments are not disabled, they can overrideoptions specified through the environment or embedded in the executable.
License:
Distributed under theBoost Software License 1.0. (See accompanying file LICENSE)
Authors:
Rainer Schuetze

Sourcert/config.d

nothrow @nogc stringrt_configOption(stringopt, scope rt_configCallBackdg = null, boolreverse = false);
get a druntime config option using standard configuration options opt name of the option to retrieve dg if non-null, passes the option through this delegate and only returns its return value if non-null reverse reverse the default processing order cmdline/envvar/rt_options to allow overwriting settings in the delegate with values from higher priority
returns the options' value if
  • set on the command line as "--DRT-=value" (rt_cmdline_enabled enabled)
  • the environment variable "DRT_" is set (rt_envvars_enabled enabled)
  • rt_options[] contains an entry "=value"
  • null otherwise
Copyright © 1999-2026 by theD Language Foundation | Page generated byDdoc on Sat Feb 21 00:06:42 2026

[8]ページ先頭

©2009-2026 Movatter.jp