@@ -169,7 +169,10 @@ bool RedhawkGCInterface::InitializeSubsystems(GCType gcType)
169169 MICROSOFT_WINDOWS_REDHAWK_GC_PUBLIC_PROVIDER_Context.RegistrationHandle = Microsoft_Windows_Redhawk_GC_PublicHandle;
170170#endif // FEATURE_ETW
171171
172- InitializeSystemInfo ();
172+ if (!InitializeSystemInfo ())
173+ {
174+ return false ;
175+ }
173176
174177 // Initialize the special EEType used to mark free list entries in the GC heap.
175178 g_FreeObjectEEType.InitializeAsGcFreeType ();
@@ -479,7 +482,7 @@ void RedhawkGCInterface::ScanHeap(GcScanObjectFunction pfnScanCallback, void *pC
479482 // Carefully attempt to set the global callback function (careful in that we won't overwrite another scan
480483 // that's being scheduled or in-progress). If someone beat us to it back off and wait for the
481484 // corresponding GC to complete.
482- while (FastInterlockCompareExchangePointer (&g_pfnHeapScan, pfnScanCallback, NULL ) != NULL )
485+ while (Interlocked::CompareExchangePointer (&g_pfnHeapScan, pfnScanCallback, NULL ) != NULL )
483486 {
484487 // Wait in pre-emptive mode to avoid stalling another thread that's attempting a collection.
485488 Thread * pCurThread = GetThread ();
@@ -509,7 +512,7 @@ void RedhawkGCInterface::ScanHeap(GcScanObjectFunction pfnScanCallback, void *pC
509512
510513 // Release our hold on the global scanning pointers.
511514 g_pvHeapScanContext = NULL ;
512- FastInterlockExchangePointer (&g_pfnHeapScan, NULL );
515+ Interlocked::ExchangePointer (&g_pfnHeapScan, NULL );
513516#else
514517 UNREFERENCED_PARAMETER (pfnScanCallback);
515518 UNREFERENCED_PARAMETER (pContext);
@@ -992,12 +995,12 @@ bool StartFinalizerThread()
992995 //
993996 static volatile Int32 fFinalizerThreadCreated ;
994997
995- if (FastInterlockExchange (&fFinalizerThreadCreated , 1 ) != 1 )
998+ if (Interlocked::Exchange (&fFinalizerThreadCreated , 1 ) != 1 )
996999 {
9971000 if (!PalStartFinalizerThread (FinalizerStart, (void *)FinalizerThread::GetFinalizerEvent ()))
9981001 {
9991002 // Need to try again another time...
1000- FastInterlockExchange (&fFinalizerThreadCreated , 0 );
1003+ Interlocked::Exchange (&fFinalizerThreadCreated , 0 );
10011004 }
10021005 }
10031006
@@ -1095,9 +1098,9 @@ bool FinalizerThread::WatchDog()
10951098
10961099 // Wait for any outstanding finalization run to complete. Time this initial operation so that it forms
10971100 // part of the overall timeout budget.
1098- DWORD dwStartTime = GetTickCount ();
1101+ DWORD dwStartTime = PalGetTickCount ();
10991102 Wait (dwTimeout);
1100- DWORD dwEndTime = GetTickCount ();
1103+ DWORD dwEndTime = PalGetTickCount ();
11011104
11021105 // In the exceedingly rare case that the tick count wrapped then we'll just reset the timeout to its
11031106 // initial value. Otherwise we'll subtract the time we waited from the timeout budget (being mindful
@@ -1156,60 +1159,14 @@ void FinalizerThread::Wait(DWORD timeout, bool allowReentrantWait)
11561159#endif // FEATURE_PREMORTEM_FINALIZATION
11571160
11581161#ifndef DACCESS_COMPILE
1159- void GetProcessMemoryLoad (GCMemoryStatus* pGCMemStatus)
1160- {
1161- // @TODO: no way to communicate failure
1162- PalGlobalMemoryStatusEx (pGCMemStatus);
1163- }
11641162
11651163bool __SwitchToThread (uint32_t /* dwSleepMSec*/ , uint32_t /* dwSwitchCount*/ )
11661164{
11671165 return !!PalSwitchToThread ();
11681166}
11691167
1170- void * ClrVirtualAlloc (
1171- void * lpAddress,
1172- size_t dwSize,
1173- uint32_t flAllocationType,
1174- uint32_t flProtect)
1175- {
1176- return PalVirtualAlloc (lpAddress, dwSize, flAllocationType, flProtect);
1177- }
1178-
1179- void * ClrVirtualAllocAligned (
1180- void * lpAddress,
1181- size_t dwSize,
1182- uint32_t flAllocationType,
1183- uint32_t flProtect,
1184- size_t /* dwAlignment*/ )
1185- {
1186- return PalVirtualAlloc (lpAddress, dwSize, flAllocationType, flProtect);
1187- }
1188-
1189- bool ClrVirtualFree (
1190- void * lpAddress,
1191- size_t dwSize,
1192- uint32_t dwFreeType)
1193- {
1194- return !!PalVirtualFree (lpAddress, dwSize, dwFreeType);
1195- }
11961168#endif // DACCESS_COMPILE
11971169
1198- bool
1199- ClrVirtualProtect (
1200- void * lpAddress,
1201- size_t dwSize,
1202- uint32_t flNewProtect,
1203- uint32_t * lpflOldProtect)
1204- {
1205- UNREFERENCED_PARAMETER (lpAddress);
1206- UNREFERENCED_PARAMETER (dwSize);
1207- UNREFERENCED_PARAMETER (flNewProtect);
1208- UNREFERENCED_PARAMETER (lpflOldProtect);
1209- ASSERT (!" ClrVirtualProtect" );
1210- return false ;
1211- }
1212-
12131170MethodTable * g_pFreeObjectMethodTable;
12141171int32_t g_TrapReturningThreads;
12151172bool g_fFinalizerRunOnShutDown;
@@ -1230,38 +1187,6 @@ VOID LogSpewAlways(const char * /*fmt*/, ...)
12301187{
12311188}
12321189
1233- CLR_MUTEX_COOKIE ClrCreateMutex (CLR_MUTEX_ATTRIBUTES lpMutexAttributes, bool bInitialOwner, LPCWSTR lpName)
1234- {
1235- UNREFERENCED_PARAMETER (lpMutexAttributes);
1236- UNREFERENCED_PARAMETER (bInitialOwner);
1237- UNREFERENCED_PARAMETER (lpName);
1238- ASSERT (!" ClrCreateMutex" );
1239- return NULL ;
1240- }
1241-
1242- void ClrCloseMutex (CLR_MUTEX_COOKIE mutex)
1243- {
1244- UNREFERENCED_PARAMETER (mutex);
1245- ASSERT (!" ClrCloseMutex" );
1246- }
1247-
1248- bool ClrReleaseMutex (CLR_MUTEX_COOKIE mutex)
1249- {
1250- UNREFERENCED_PARAMETER (mutex);
1251- ASSERT (!" ClrReleaseMutex" );
1252- return true ;
1253- }
1254-
1255- uint32_t ClrWaitForMutex (CLR_MUTEX_COOKIE mutex, uint32_t dwMilliseconds, bool bAlertable)
1256- {
1257- UNREFERENCED_PARAMETER (mutex);
1258- UNREFERENCED_PARAMETER (dwMilliseconds);
1259- UNREFERENCED_PARAMETER (bAlertable);
1260- ASSERT (!" ClrWaitForMutex" );
1261- return WAIT_OBJECT_0;
1262- }
1263-
1264-
12651190uint32_t CLRConfig::GetConfigValue (ConfigDWORDInfo eType)
12661191{
12671192 switch (eType)
0 commit comments