From 0834425813497593ceda8bb0ae12dcc463011d7c Mon Sep 17 00:00:00 2001 From: Sean Gillespie Date: Tue, 30 May 2017 17:20:16 -0400 Subject: [Local GC] Obtaining configuration information (#11379) * [Local GC] Skeleton for GC configuration * Initial tweaks after design feedback: 1) Use string keys instead of enums. Upon receiving a string key, the EE looks at it and, if it's something that comes from startup flags, responds using the startup flag information. Otherwise, it forwards the string onto CLRConfig. 2) Add a mechanism for getting string configuration values from the EE. This includes adding a RAII wrapper around strings so that they are freed correctly. * Remove uses of g_pConfig from the GC and replace with GCConfig * Use the GCConfig system for the GC log * Fix poorly-named parameter * Add documentation and caching of bool and int configs obtained from the EE * Remove AppDomainLeaks as dead code * Remove GC trace configs as dead code * Repair unix build * Fix an issue where we started the GC in the wrong latency mode * Fix the unix build * Pipe GCRetainVM configuration to the GC * Dead code removal in the GC sample * EEConfig -> GCConfig for heap verification constants in the GC * Populate config information for bools and ints eagerly at startup * Initialize g_theGCToCLR before initializing GCConfig * Propegate HoardVM config to the GC * Fix an incorrect comment --- src/gc/sample/CMakeLists.txt | 1 + src/gc/sample/gcenv.ee.cpp | 51 +++++++++++--------------------------------- 2 files changed, 14 insertions(+), 38 deletions(-) (limited to 'src/gc/sample') diff --git a/src/gc/sample/CMakeLists.txt b/src/gc/sample/CMakeLists.txt index 5fe7887963..42f097a6e3 100644 --- a/src/gc/sample/CMakeLists.txt +++ b/src/gc/sample/CMakeLists.txt @@ -8,6 +8,7 @@ include_directories(../env) set(SOURCES GCSample.cpp gcenv.ee.cpp + ../gcconfig.cpp ../gccommon.cpp ../gceewks.cpp ../gchandletable.cpp diff --git a/src/gc/sample/gcenv.ee.cpp b/src/gc/sample/gcenv.ee.cpp index fa6efbf2d6..03d960819a 100644 --- a/src/gc/sample/gcenv.ee.cpp +++ b/src/gc/sample/gcenv.ee.cpp @@ -286,64 +286,39 @@ bool GCToEEInterface::EagerFinalized(Object* obj) return false; } -MethodTable* GCToEEInterface::GetFreeObjectMethodTable() +bool GCToEEInterface::GetBooleanConfigValue(const char* key, bool* value) { - return g_pFreeObjectMethodTable; + return false; } -bool IsGCSpecialThread() +bool GCToEEInterface::GetIntConfigValue(const char* key, int64_t* value) { - // TODO: Implement for background GC return false; } -bool IsGCThread() +bool GCToEEInterface::GetStringConfigValue(const char* key, const char** value) { return false; } -void SwitchToWriteWatchBarrier() +void GCToEEInterface::FreeStringConfigValue(const char *value) { -} -void SwitchToNonWriteWatchBarrier() -{ } -void LogSpewAlways(const char * /*fmt*/, ...) +MethodTable* GCToEEInterface::GetFreeObjectMethodTable() { + return g_pFreeObjectMethodTable; } -uint32_t CLRConfig::GetConfigValue(ConfigDWORDInfo eType) +bool IsGCSpecialThread() { - switch (eType) - { - case UNSUPPORTED_BGCSpinCount: - return 140; - - case UNSUPPORTED_BGCSpin: - return 2; - - case UNSUPPORTED_GCLogEnabled: - case UNSUPPORTED_GCLogFile: - case UNSUPPORTED_GCLogFileSize: - case EXTERNAL_GCStressStart: - case INTERNAL_GCStressStartAtJit: - case INTERNAL_DbgDACSkipVerifyDlls: - return 0; - - case Config_COUNT: - default: -#ifdef _MSC_VER -#pragma warning(suppress:4127) // Constant conditional expression in ASSERT below -#endif - ASSERT(!"Unknown config value type"); - return 0; - } + // TODO: Implement for background GC + return false; } -HRESULT CLRConfig::GetConfigValue(ConfigStringInfo /*eType*/, TCHAR * * outVal) +bool IsGCThread() { - *outVal = NULL; - return 0; + return false; } + -- cgit v1.2.3