diff options
author | Jan Kotas <jkotas@microsoft.com> | 2019-02-07 10:17:45 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-07 10:17:45 -0800 |
commit | 46cbd93c20780bcacd9f39fe18079acf2a9f4178 (patch) | |
tree | 560b624f2aa28894d16ba410b7aae4d726851cef | |
parent | f340a5f9248bf90a9acb58231f8aebe0189eb6ef (diff) | |
download | coreclr-46cbd93c20780bcacd9f39fe18079acf2a9f4178.tar.gz coreclr-46cbd93c20780bcacd9f39fe18079acf2a9f4178.tar.bz2 coreclr-46cbd93c20780bcacd9f39fe18079acf2a9f4178.zip |
Fix GCSample bit rot (#22462)
Fixes #22459
-rw-r--r-- | src/gc/sample/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/gc/sample/GCSample.cpp | 8 | ||||
-rw-r--r-- | src/gc/sample/GCSample.vcxproj | 17 | ||||
-rw-r--r-- | src/gc/sample/GCSample.vcxproj.filters | 14 | ||||
-rw-r--r-- | src/gc/sample/gcenv.ee.cpp | 11 | ||||
-rw-r--r-- | src/gc/sample/gcenv.h | 2 |
6 files changed, 35 insertions, 19 deletions
diff --git a/src/gc/sample/CMakeLists.txt b/src/gc/sample/CMakeLists.txt index 953d0498e0..5a02d0262e 100644 --- a/src/gc/sample/CMakeLists.txt +++ b/src/gc/sample/CMakeLists.txt @@ -5,8 +5,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) include_directories(..) include_directories(../env) -add_definitions(-DFEATURE_REDHAWK) - set(SOURCES GCSample.cpp gcenv.ee.cpp diff --git a/src/gc/sample/GCSample.cpp b/src/gc/sample/GCSample.cpp index 4248d92256..4e228509dc 100644 --- a/src/gc/sample/GCSample.cpp +++ b/src/gc/sample/GCSample.cpp @@ -119,14 +119,6 @@ int __cdecl main(int argc, char* argv[]) return -1; } - // - // Initialize free object methodtable. The GC uses a special array-like methodtable as placeholder - // for collected free space. - // - static MethodTable freeObjectMT; - freeObjectMT.InitializeFreeObject(); - g_gc_pFreeObjectMethodTable = &freeObjectMT; - // // Initialize GC heap // diff --git a/src/gc/sample/GCSample.vcxproj b/src/gc/sample/GCSample.vcxproj index 105e289c1a..de161647d1 100644 --- a/src/gc/sample/GCSample.vcxproj +++ b/src/gc/sample/GCSample.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -14,18 +14,19 @@ <ProjectGuid>{58D6B7AE-0A12-49F0-BCF7-200ED8BA445A}</ProjectGuid> <Keyword>Win32Proj</Keyword> <RootNamespace>GCSample</RootNamespace> + <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> + <PlatformToolset>v141</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> + <PlatformToolset>v141</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> @@ -83,13 +84,17 @@ <ClInclude Include="gcenv.h" /> </ItemGroup> <ItemGroup> - <ClCompile Include="gcenv.ee.cpp" /> <ClCompile Include="GCSample.cpp" /> - <ClCompile Include="..\gccommon.cpp" /> - <ClCompile Include="..\gceewks.cpp" /> + <ClCompile Include="gcenv.ee.cpp" /> <ClCompile Include="..\windows\gcenv.windows.cpp"> <PrecompiledHeader>NotUsing</PrecompiledHeader> </ClCompile> + <ClCompile Include="..\gcconfig.cpp" /> + <ClCompile Include="..\gceventstatus.cpp" /> + <ClCompile Include="..\gchandletable.cpp" /> + <ClCompile Include="..\gcload.cpp" /> + <ClCompile Include="..\gccommon.cpp" /> + <ClCompile Include="..\gceewks.cpp" /> <ClCompile Include="..\gcscan.cpp" /> <ClCompile Include="..\gcwks.cpp" /> <ClCompile Include="..\handletable.cpp" /> diff --git a/src/gc/sample/GCSample.vcxproj.filters b/src/gc/sample/GCSample.vcxproj.filters index f6aacfd0c7..b5647b3fcb 100644 --- a/src/gc/sample/GCSample.vcxproj.filters +++ b/src/gc/sample/GCSample.vcxproj.filters @@ -59,7 +59,19 @@ <ClCompile Include="gcenv.ee.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="..\gcenv.windows.cpp"> + <ClCompile Include="..\windows\gcenv.windows.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\gchandletable.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\gcconfig.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\gcload.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\gceventstatus.cpp"> <Filter>Source Files</Filter> </ClCompile> </ItemGroup> diff --git a/src/gc/sample/gcenv.ee.cpp b/src/gc/sample/gcenv.ee.cpp index 20be78cc93..9a4e9c9a74 100644 --- a/src/gc/sample/gcenv.ee.cpp +++ b/src/gc/sample/gcenv.ee.cpp @@ -319,9 +319,16 @@ bool GCToEEInterface::WasCurrentThreadCreatedByGC() return false; } +static MethodTable freeObjectMT; + MethodTable* GCToEEInterface::GetFreeObjectMethodTable() { - return g_pFreeObjectMethodTable; + // + // Initialize free object methodtable. The GC uses a special array-like methodtable as placeholder + // for collected free space. + // + freeObjectMT.InitializeFreeObject(); + return &freeObjectMT; } bool GCToEEInterface::CreateThread(void (*threadStart)(void*), void* arg, bool is_suspendable, const char* name) @@ -349,7 +356,7 @@ void *GCToEEInterface::GetAppDomainAtIndex(uint32_t appDomainIndex) bool GCToEEInterface::AppDomainCanAccessHandleTable(uint32_t appDomainID) { - return false; + return true; } uint32_t GCToEEInterface::GetIndexOfAppDomainBeingUnloaded() diff --git a/src/gc/sample/gcenv.h b/src/gc/sample/gcenv.h index 4dc2da0a89..0da2e44023 100644 --- a/src/gc/sample/gcenv.h +++ b/src/gc/sample/gcenv.h @@ -10,6 +10,8 @@ #undef BUILD_AS_STANDALONE #endif // BUILD_AS_STANDALONE +#define FEATURE_REDHAWK + #if defined(_DEBUG) #ifndef _DEBUG_IMPL #define _DEBUG_IMPL 1 |