ページの改善
いますぐフォークしてオンライン編集し、このページのプルリクエストを送信します。
Github へのログインが必要です。 これは小さな変更に適しています。
大きな変更を加えたい場合は、通常の cloneの使用をお勧めします。
日本語版について
個人的な学習のために、dlang.orgを翻訳したサイトです。
翻訳に際して、様々なサイトを参考にしています。
rt.config
Configuration options for druntime.
The default way to configure the runtime is by passing command line arguments
starting with --DRT- and followed by the option name, e.g. --DRT-gcopt to
configure the GC.
When command line parsing is enabled, command line options starting
with --DRT- are filtered out before calling main, so the program
will not see them. They are still available via rt_args().
Configuration via the command line can be disabled by declaring a variable for the
linker to pick up before using it's default from the runtime:
extern(C) __gshared bool rt_cmdline_enabled = false;Likewise, declare a boolean rt_envvars_enabled to enable configuration via the environment variable DRT_ followed by the option name, e.g. DRT_GCOPT:
extern(C) __gshared bool rt_envvars_enabled = true;Setting default configuration properties in the executable can be done by specifying an array of options named rt_options:
extern(C) __gshared string[] rt_options = [ "gcopt=precise:1 profile:1"];Evaluation order of options is rt_options, then environment variables, then command line arguments, i.e. if command line arguments are not disabled, they can override options specified through the environment or embedded in the executable.
License:
Distributed under the
Boost Software License 1.0.
(See accompanying file LICENSE)
Authors:
Rainer Schuetze
Source rt/config.d
- nothrow @nogc string
rt_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 priorityreturns 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
- set on the command line as "--DRT-
Copyright © 1999-2022 by the D Language Foundation | Page generated by
Ddoc on Wed Nov 23 08:33:06 2022