From 54aeda44f2fa18f4d868b218a446000d76619f5d Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Sat, 20 Mar 2021 19:39:36 -0700 Subject: [PATCH 1/2] Remove unnecessary property setting in corerun. --- src/coreclr/hosts/corerun/corerun.cpp | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/coreclr/hosts/corerun/corerun.cpp b/src/coreclr/hosts/corerun/corerun.cpp index ed2f059b159758..95c4e15db9995c 100644 --- a/src/coreclr/hosts/corerun/corerun.cpp +++ b/src/coreclr/hosts/corerun/corerun.cpp @@ -57,15 +57,6 @@ namespace envvar // Variable used to preload a mock hostpolicy for testing. const char_t* mockHostPolicy = W("MOCK_HOSTPOLICY"); - - // Name of the environment variable controlling server GC. - // If set to 1, server GC is enabled on startup. If 0, server GC is - // disabled. Server GC is off by default. - const char_t* serverGc = W("COMPlus_gcServer"); - - // Environment variable for setting whether or not to use Concurrent GC. - // On by default. - const char_t* concurrentGc = W("COMPlus_gcConcurrent"); } static void wait_for_debugger() @@ -190,7 +181,7 @@ class logger_t final , _argv{ argv } { } - void dump_details(FILE* fd = stderr) + void dump_details(FILE* fd = stdout) { // Using std::fprintf since values have been converted to UTF-8. std::fprintf(fd, "Exe path: %s\n", _exePath); @@ -308,8 +299,6 @@ static int run(const configuration& config) pal::string_utf8_t app_path_utf8 = pal::convert_to_utf8(std::move(app_path)); pal::string_utf8_t app_path_ni_utf8 = pal::convert_to_utf8(std::move(app_path_ni)); pal::string_utf8_t native_search_dirs_utf8 = pal::convert_to_utf8(native_search_dirs.str()); - const char* enable_server_gc = get_envvar_as_boolean(envvar::serverGc); - const char* enable_concurrent_gc = get_envvar_as_boolean(envvar::concurrentGc, true /* default */); // Allowed property names: // @@ -330,8 +319,6 @@ static int run(const configuration& config) "APP_PATHS", "APP_NI_PATHS", "NATIVE_DLL_SEARCH_DIRECTORIES", - "System.GC.Server", - "System.GC.Concurrent", }; const char* propertyValues[] = @@ -344,10 +331,6 @@ static int run(const configuration& config) app_path_ni_utf8.c_str(), // NATIVE_DLL_SEARCH_DIRECTORIES native_search_dirs_utf8.c_str(), - // System.GC.Server - enable_server_gc, - // System.GC.Concurrent - enable_concurrent_gc, }; int propertyCount = (int)(sizeof(propertyKeys) / sizeof(propertyKeys[0])); From 701c07ccb7f15d7d5ece5b289f1fb89c8bececdc Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Sat, 20 Mar 2021 21:50:24 -0700 Subject: [PATCH 2/2] Remove unused get_envvar_as_boolean() --- src/coreclr/hosts/corerun/corerun.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/coreclr/hosts/corerun/corerun.cpp b/src/coreclr/hosts/corerun/corerun.cpp index 95c4e15db9995c..63390bde8d5108 100644 --- a/src/coreclr/hosts/corerun/corerun.cpp +++ b/src/coreclr/hosts/corerun/corerun.cpp @@ -146,18 +146,6 @@ static bool try_get_export(pal::mod_t mod, const char* symbol, void** fptr) return false; } -static const char* get_envvar_as_boolean(const char_t* var, bool def = false) -{ - string_t val = pal::getenv(var); - if (val.empty()) - val = def ? W("1") : W("0"); - - // CoreCLR expects strings "true" and "false" instead of "1" and "0". - return (val.compare(W("1")) == 0 || val.compare(W("true")) == 0 || val.compare(W("TRUE")) == 0) - ? "true" - : "false"; -} - class logger_t final { const char* _exePath;