diff options
author | Jan Kotas <jkotas@microsoft.com> | 2016-01-08 14:04:23 -0800 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2016-01-08 14:04:23 -0800 |
commit | 061a96e54c9ddc7a4141a364b60fd001d27cee30 (patch) | |
tree | 9f3a0592f7a75ba09f9544775f601329eae1e573 | |
parent | 2a52c91242ca3010803e85f5857b977f470a0510 (diff) | |
download | coreclr-061a96e54c9ddc7a4141a364b60fd001d27cee30.tar.gz coreclr-061a96e54c9ddc7a4141a364b60fd001d27cee30.tar.bz2 coreclr-061a96e54c9ddc7a4141a364b60fd001d27cee30.zip |
Fix building of GCSample on x86 via the standalone VS project
-rw-r--r-- | src/gc/env/gcenv.base.h | 2 | ||||
-rw-r--r-- | src/gc/sample/GCSample.vcxproj | 4 | ||||
-rw-r--r-- | src/gc/sample/gcenv.ee.cpp | 2 | ||||
-rw-r--r-- | src/gc/sample/gcenv.windows.cpp | 18 |
4 files changed, 16 insertions, 10 deletions
diff --git a/src/gc/env/gcenv.base.h b/src/gc/env/gcenv.base.h index b7dbd84c5c..791648fe8a 100644 --- a/src/gc/env/gcenv.base.h +++ b/src/gc/env/gcenv.base.h @@ -82,7 +82,7 @@ inline HRESULT HRESULT_FROM_WIN32(unsigned long x) #define TRUE true #define FALSE false -#define CALLBACK +#define CALLBACK __stdcall #define FORCEINLINE inline #define INFINITE 0xFFFFFFFF diff --git a/src/gc/sample/GCSample.vcxproj b/src/gc/sample/GCSample.vcxproj index eefca17fb3..b196e1f34c 100644 --- a/src/gc/sample/GCSample.vcxproj +++ b/src/gc/sample/GCSample.vcxproj @@ -50,7 +50,7 @@ <PrecompiledHeader>Use</PrecompiledHeader> <WarningLevel>Level3</WarningLevel> <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WIN32;_X86_;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> <SDLCheck>true</SDLCheck> <PrecompiledHeaderFile>common.h</PrecompiledHeaderFile> <AdditionalIncludeDirectories>.;..;..\env</AdditionalIncludeDirectories> @@ -67,7 +67,7 @@ <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WIN32;_X86_;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> <SDLCheck>true</SDLCheck> <AdditionalIncludeDirectories>.;..;..\env</AdditionalIncludeDirectories> </ClCompile> diff --git a/src/gc/sample/gcenv.ee.cpp b/src/gc/sample/gcenv.ee.cpp index a1a0360f20..e17bb834fa 100644 --- a/src/gc/sample/gcenv.ee.cpp +++ b/src/gc/sample/gcenv.ee.cpp @@ -230,7 +230,7 @@ bool FinalizerThread::HaveExtraWorkForFinalizer() return false; } -bool PalStartBackgroundGCThread(BackgroundCallback callback, void* pCallbackContext) +bool REDHAWK_PALAPI PalStartBackgroundGCThread(BackgroundCallback callback, void* pCallbackContext) { // TODO: Implement for background GC return false; diff --git a/src/gc/sample/gcenv.windows.cpp b/src/gc/sample/gcenv.windows.cpp index c9f0edb1f2..6fbc21ab14 100644 --- a/src/gc/sample/gcenv.windows.cpp +++ b/src/gc/sample/gcenv.windows.cpp @@ -366,10 +366,15 @@ struct GCThreadStubParam }; // GC thread stub to convert GC thread function to an OS specific thread function -static DWORD GCThreadStub(void* param) +static DWORD __stdcall GCThreadStub(void* param) { GCThreadStubParam *stubParam = (GCThreadStubParam*)param; - stubParam->GCThreadFunction(stubParam->GCThreadParam); + GCThreadFunction function = stubParam->GCThreadFunction; + void* threadParam = stubParam->GCThreadParam; + + delete stubParam; + + function(threadParam); return 0; } @@ -384,15 +389,16 @@ static DWORD GCThreadStub(void* param) bool GCToOSInterface::CreateThread(GCThreadFunction function, void* param, GCThreadAffinity* affinity) { DWORD thread_id; - GCThreadStubParam stubParam; - stubParam.GCThreadFunction = function; - stubParam.GCThreadParam = param; + GCThreadStubParam* stubParam = new (nothrow) GCThreadStubParam(); + stubParam->GCThreadFunction = function; + stubParam->GCThreadParam = param; - HANDLE gc_thread = ::CreateThread(NULL, 0, GCThreadStub, &stubParam, CREATE_SUSPENDED, &thread_id); + HANDLE gc_thread = ::CreateThread(NULL, 0, GCThreadStub, stubParam, CREATE_SUSPENDED, &thread_id); if (!gc_thread) { + delete stubParam; return false; } |