summaryrefslogtreecommitdiff
path: root/src/inc/clrhost.h
diff options
context:
space:
mode:
authorSteve Harter <sharter@microsoft.com>2015-12-16 14:27:26 -0600
committerSteve Harter <sharter@microsoft.com>2016-01-21 15:23:16 -0600
commit00ac45086dd1f773431990f88336e44795c1fbe9 (patch)
treeb2706ff87c19aef732aa10c37d08b51ce38006de /src/inc/clrhost.h
parent2d2e591da6dac49bc762344430bf6c23257fcc79 (diff)
downloadcoreclr-00ac45086dd1f773431990f88336e44795c1fbe9.tar.gz
coreclr-00ac45086dd1f773431990f88336e44795c1fbe9.tar.bz2
coreclr-00ac45086dd1f773431990f88336e44795c1fbe9.zip
Reduce clr startup noise when using Clang sanitizers
Diffstat (limited to 'src/inc/clrhost.h')
-rw-r--r--src/inc/clrhost.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/inc/clrhost.h b/src/inc/clrhost.h
index 8268c9a69b..3d1a8fae04 100644
--- a/src/inc/clrhost.h
+++ b/src/inc/clrhost.h
@@ -85,6 +85,8 @@ void ClrFlsAssociateCallback(DWORD slot, PTLS_CALLBACK_FUNCTION callback);
// Function pointer for fast TLS fetch - do not use directly
typedef LPVOID (*POPTIMIZEDTLSGETTER)();
+typedef LPVOID* (*CLRFLSGETBLOCK)();
+
extern POPTIMIZEDTLSGETTER __ClrFlsGetBlock;
#ifndef CLR_STANDALONE_BINDER
@@ -98,8 +100,9 @@ inline void ClrFlsIncrementValue(DWORD slot, int increment)
STATIC_CONTRACT_SO_TOLERANT;
_ASSERTE(increment != 0);
-
- void **block = (void **) (*__ClrFlsGetBlock)();
+
+ CLRFLSGETBLOCK clrFlsGetBlockFn = (CLRFLSGETBLOCK)__ClrFlsGetBlock;
+ void **block = (*clrFlsGetBlockFn)();
size_t value;
if (block != NULL)
@@ -134,7 +137,8 @@ inline void * ClrFlsGetValue (DWORD slot)
STATIC_CONTRACT_CANNOT_TAKE_LOCK;
STATIC_CONTRACT_SO_TOLERANT;
- void **block = (void **) (*__ClrFlsGetBlock)();
+ CLRFLSGETBLOCK clrFlsGetBlockFn = (CLRFLSGETBLOCK)__ClrFlsGetBlock;
+ void **block = (*clrFlsGetBlockFn)();
if (block != NULL)
{
return block[slot];
@@ -159,7 +163,8 @@ inline BOOL ClrFlsCheckValue(DWORD slot, void ** pValue)
#ifdef _DEBUG
*pValue = ULongToPtr(0xcccccccc);
#endif //_DEBUG
- void **block = (void **) (*__ClrFlsGetBlock)();
+ CLRFLSGETBLOCK clrFlsGetBlockFn = (CLRFLSGETBLOCK)__ClrFlsGetBlock;
+ void **block = (*clrFlsGetBlockFn)();
if (block != NULL)
{
*pValue = block[slot];
@@ -181,7 +186,8 @@ inline void ClrFlsSetValue(DWORD slot, void *pData)
STATIC_CONTRACT_CANNOT_TAKE_LOCK;
STATIC_CONTRACT_SO_TOLERANT;
- void **block = (void **) (*__ClrFlsGetBlock)();
+ CLRFLSGETBLOCK clrFlsGetBlockFn = (CLRFLSGETBLOCK)__ClrFlsGetBlock;
+ void **block = (*clrFlsGetBlockFn)();
if (block != NULL)
{
block[slot] = pData;