Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Switch GCSample to the canonical GCToOSInterface implementation (#8653)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotas committed Dec 15, 2016
1 parent 0ba60ef commit 7e9bce2
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 480 deletions.
2 changes: 0 additions & 2 deletions src/gc/gcenv.unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#include "env/gcenv.base.h"
#include "env/gcenv.os.h"

#error This file should not be compiled!

// Initialize the interface implementation
// Return:
// true if it has succeeded, false if it has failed
Expand Down
6 changes: 1 addition & 5 deletions src/gc/gcenv.windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
#include "env/gcenv.base.h"
#include "env/gcenv.os.h"

#ifndef FEATURE_STANDALONE_GC
#error This file should only be compiled for a standalone GC
#endif // FEATURE_STANDALONE_GC

GCSystemInfo g_SystemInfo;

typedef BOOL (WINAPI *PGET_PROCESS_MEMORY_INFO)(HANDLE handle, PROCESS_MEMORY_COUNTERS* memCounters, uint32_t cb);
Expand Down Expand Up @@ -422,7 +418,7 @@ size_t GCToOSInterface::GetVirtualMemoryLimit()
MEMORYSTATUSEX memStatus;
if (::GlobalMemoryStatusEx(&memStatus))
{
return memStatus.ullAvailVirtual;
return (size_t)memStatus.ullAvailVirtual;
}

return 0;
Expand Down
4 changes: 2 additions & 2 deletions src/gc/sample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ set(SOURCES

if(WIN32)
list(APPEND SOURCES
gcenv.windows.cpp)
../gcenv.windows.cpp)
add_definitions(-DUNICODE=1)
else()
list(APPEND SOURCES
gcenv.unix.cpp)
../gcenv.unix.cpp)
endif()

_add_executable(gcsample
Expand Down
7 changes: 4 additions & 3 deletions src/gc/sample/GCSample.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="gcenv.ee.cpp" />
<ClCompile Include="gcenv.windows.cpp" />
<ClCompile Include="GCSample.cpp" />
<ClCompile Include="..\gccommon.cpp" />
<ClCompile Include="..\gceewks.cpp" />
<ClCompile Include="..\gcenv.windows.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\gcscan.cpp" />
<ClCompile Include="..\gcwks.cpp" />
<ClCompile Include="..\handletable.cpp" />
Expand All @@ -96,8 +98,7 @@
<ClCompile Include="..\handletablescan.cpp" />
<ClCompile Include="..\objecthandle.cpp" />
<ClCompile Include="..\env\common.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
2 changes: 1 addition & 1 deletion src/gc/sample/GCSample.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<ClCompile Include="gcenv.ee.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="gcenv.windows.cpp">
<ClCompile Include="..\gcenv.windows.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions src/gc/sample/gcenv.ee.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
#include "gcenv.h"
#include "gc.h"

MethodTable * g_pFreeObjectMethodTable;

int32_t g_TrapReturningThreads;

bool g_fFinalizerRunOnShutDown;

EEConfig * g_pConfig;

bool CLREventStatic::CreateManualEventNoThrow(bool bInitialState)
Expand Down
14 changes: 0 additions & 14 deletions src/gc/sample/gcenv.unix.cpp

This file was deleted.

Loading

0 comments on commit 7e9bce2

Please sign in to comment.