summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2015-10-31 21:47:12 -0700
committerJan Kotas <jkotas@microsoft.com>2015-10-31 21:47:12 -0700
commit83b2cb83b32faa45b4f790237b5c5e259692294a (patch)
treec78ab81e3a9b25bb83e83ec155de42deaacff093
parentd31fc8f4cb86665186c1fa9366e516704e2dc8c5 (diff)
parent1eb7a35827a1b1ae2b71a9d45f7558a6c774c3c3 (diff)
downloadcoreclr-83b2cb83b32faa45b4f790237b5c5e259692294a.tar.gz
coreclr-83b2cb83b32faa45b4f790237b5c5e259692294a.tar.bz2
coreclr-83b2cb83b32faa45b4f790237b5c5e259692294a.zip
Merge pull request #1920 from jkotas/gcsample
Fix build breaks in GCSample
-rw-r--r--src/gc/env/gcenv.base.h18
-rw-r--r--src/gc/env/gcenv.object.h6
-rw-r--r--src/gc/gc.cpp5
-rw-r--r--src/gc/handletablescan.cpp1
-rw-r--r--src/gc/sample/GCSample.cpp2
-rw-r--r--src/gc/sample/gcenv.cpp2
-rw-r--r--src/gc/sample/gcenv.h13
7 files changed, 28 insertions, 19 deletions
diff --git a/src/gc/env/gcenv.base.h b/src/gc/env/gcenv.base.h
index 74288a2d5f..b1239afc21 100644
--- a/src/gc/env/gcenv.base.h
+++ b/src/gc/env/gcenv.base.h
@@ -439,15 +439,6 @@ struct _DacGlobals;
#define OS_PAGE_SIZE 4096
-#if defined(_DEBUG)
-#ifndef _DEBUG_IMPL
-#define _DEBUG_IMPL 1
-#endif
-#define ASSERT(_expr) assert(_expr)
-#else
-#define ASSERT(_expr)
-#endif
-
#ifndef _ASSERTE
#define _ASSERTE(_expr) ASSERT(_expr)
#endif
@@ -864,6 +855,8 @@ public:
UNSUPPORTED_GCLogEnabled,
UNSUPPORTED_GCLogFile,
UNSUPPORTED_GCLogFileSize,
+ UNSUPPORTED_GCConfigLogEnabled,
+ UNSUPPORTED_GCConfigLogFile,
UNSUPPORTED_BGCSpinCount,
UNSUPPORTED_BGCSpin,
EXTERNAL_GCStressStart,
@@ -872,7 +865,10 @@ public:
Config_COUNT
};
- static DWORD GetConfigValue(CLRConfigTypes eType)
+ typedef CLRConfigTypes ConfigDWORDInfo;
+ typedef CLRConfigTypes ConfigStringInfo;
+
+ static DWORD GetConfigValue(ConfigDWORDInfo eType)
{
switch (eType)
{
@@ -900,7 +896,7 @@ public:
}
}
- static HRESULT GetConfigValue(CLRConfigTypes eType, PWSTR * outVal)
+ static HRESULT GetConfigValue(ConfigStringInfo eType, PWSTR * outVal)
{
*outVal = NULL;
return 0;
diff --git a/src/gc/env/gcenv.object.h b/src/gc/env/gcenv.object.h
index 327f5e4910..f88c93e263 100644
--- a/src/gc/env/gcenv.object.h
+++ b/src/gc/env/gcenv.object.h
@@ -120,12 +120,12 @@ public:
return m_pMethTab;
}
- void RawSetMethodTable(MethodTable * pMT)
+ MethodTable * GetGCSafeMethodTable() const
{
- m_pMethTab = pMT;
+ return (MethodTable *)((uintptr_t)m_pMethTab & ~3);
}
- void SetMethodTable(MethodTable * pMT)
+ void RawSetMethodTable(MethodTable * pMT)
{
m_pMethTab = pMT;
}
diff --git a/src/gc/gc.cpp b/src/gc/gc.cpp
index f16f54d5b9..b870e1d01e 100644
--- a/src/gc/gc.cpp
+++ b/src/gc/gc.cpp
@@ -9478,7 +9478,7 @@ HANDLE CreateLogFile(const CLRConfig::ConfigStringInfo & info, BOOL is_config)
CLRConfig::GetConfigValue(info, &temp_logfile_name);
#ifdef FEATURE_REDHAWK
- gc_log = PalCreateFileW(
+ return PalCreateFileW(
temp_logfile_name,
GENERIC_WRITE,
FILE_SHARE_READ,
@@ -9501,7 +9501,7 @@ HANDLE CreateLogFile(const CLRConfig::ConfigStringInfo & info, BOOL is_config)
strcat_s(logfile_name, _countof(logfile_name), szPid);
strcat_s(logfile_name, _countof(logfile_name), (is_config ? ".config.log" : ".log"));
- HANDLE hFile = CreateFileA(
+ return CreateFileA(
logfile_name,
GENERIC_WRITE,
FILE_SHARE_READ,
@@ -9510,7 +9510,6 @@ HANDLE CreateLogFile(const CLRConfig::ConfigStringInfo & info, BOOL is_config)
FILE_ATTRIBUTE_NORMAL,
NULL);
#endif //FEATURE_REDHAWK
- return hFile;
}
#endif //TRACE_GC || GC_CONFIG_DRIVEN
diff --git a/src/gc/handletablescan.cpp b/src/gc/handletablescan.cpp
index 8d9c77c4c7..6f944103b1 100644
--- a/src/gc/handletablescan.cpp
+++ b/src/gc/handletablescan.cpp
@@ -18,6 +18,7 @@
#include "gc.h"
+#include "objecthandle.h"
#include "handletablepriv.h"
#ifndef FEATURE_REDHAWK
diff --git a/src/gc/sample/GCSample.cpp b/src/gc/sample/GCSample.cpp
index 071a87f360..38bcaa507e 100644
--- a/src/gc/sample/GCSample.cpp
+++ b/src/gc/sample/GCSample.cpp
@@ -74,7 +74,7 @@ Object * AllocateObject(MethodTable * pMT)
return NULL;
}
- pObject->SetMethodTable(pMT);
+ pObject->RawSetMethodTable(pMT);
return pObject;
}
diff --git a/src/gc/sample/gcenv.cpp b/src/gc/sample/gcenv.cpp
index 45af9bce51..f1d6cfad0f 100644
--- a/src/gc/sample/gcenv.cpp
+++ b/src/gc/sample/gcenv.cpp
@@ -92,7 +92,7 @@ bool GCToEEInterface::RefCountedHandleCallbacks(Object * pObject)
bool GCToEEInterface::IsPreemptiveGCDisabled(Thread * pThread)
{
- return !!pThread->PreemptiveGCDisabled();
+ return pThread->PreemptiveGCDisabled();
}
void GCToEEInterface::EnablePreemptiveGC(Thread * pThread)
diff --git a/src/gc/sample/gcenv.h b/src/gc/sample/gcenv.h
index 327aa36965..1a9fac5717 100644
--- a/src/gc/sample/gcenv.h
+++ b/src/gc/sample/gcenv.h
@@ -3,6 +3,19 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
+#if defined(_DEBUG)
+#ifndef _DEBUG_IMPL
+#define _DEBUG_IMPL 1
+#endif
+#define ASSERT(_expr) assert(_expr)
+#else
+#define ASSERT(_expr)
+#endif
+
+#ifndef _ASSERTE
+#define _ASSERTE(_expr) ASSERT(_expr)
+#endif
+
#include "gcenv.base.h"
#include "gcenv.object.h"
#include "gcenv.sync.h"