From cfb1a0b47dd2e352413302755bca1c1d09e072d2 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Thu, 19 Nov 2015 20:31:33 -0800 Subject: [PATCH] Fix build breaks after GC update --- src/gc/env/gcenv.windows.cpp | 14 +++++++------- src/gc/gcee.cpp | 2 +- src/gc/objecthandle.cpp | 4 ++-- src/vm/gcenv.h | 18 +++++++++++++++++- 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/gc/env/gcenv.windows.cpp b/src/gc/env/gcenv.windows.cpp index 0882165..1059e5e 100644 --- a/src/gc/env/gcenv.windows.cpp +++ b/src/gc/env/gcenv.windows.cpp @@ -16,27 +16,27 @@ int32_t FastInterlockIncrement(int32_t volatile *lpAddend) { - return InterlockedIncrement((int32_t *)lpAddend); + return InterlockedIncrement((LONG *)lpAddend); } int32_t FastInterlockDecrement(int32_t volatile *lpAddend) { - return InterlockedDecrement((int32_t *)lpAddend); + return InterlockedDecrement((LONG *)lpAddend); } int32_t FastInterlockExchange(int32_t volatile *Target, int32_t Value) { - return InterlockedExchange((int32_t *)Target, Value); + return InterlockedExchange((LONG *)Target, Value); } int32_t FastInterlockCompareExchange(int32_t volatile *Destination, int32_t Exchange, int32_t Comperand) { - return InterlockedCompareExchange((int32_t *)Destination, Exchange, Comperand); + return InterlockedCompareExchange((LONG *)Destination, Exchange, Comperand); } int32_t FastInterlockExchangeAdd(int32_t volatile *Addend, int32_t Value) { - return InterlockedExchangeAdd((int32_t *)Addend, Value); + return InterlockedExchangeAdd((LONG *)Addend, Value); } void * _FastInterlockExchangePointer(void * volatile *Target, void * Value) @@ -51,12 +51,12 @@ void * _FastInterlockCompareExchangePointer(void * volatile *Destination, void * void FastInterlockOr(uint32_t volatile *p, uint32_t msk) { - InterlockedOr((int32_t volatile *)p, msk); + InterlockedOr((LONG volatile *)p, msk); } void FastInterlockAnd(uint32_t volatile *p, uint32_t msk) { - InterlockedAnd((int32_t volatile *)p, msk); + InterlockedAnd((LONG volatile *)p, msk); } diff --git a/src/gc/gcee.cpp b/src/gc/gcee.cpp index 8270799..ad20009 100644 --- a/src/gc/gcee.cpp +++ b/src/gc/gcee.cpp @@ -628,7 +628,7 @@ BOOL GCHeap::IsConcurrentGCInProgress() void gc_heap::fire_etw_allocation_event (size_t allocation_amount, int gen_number, uint8_t* object_address) { void * typeId = nullptr; - wchar_t * name = nullptr; + const WCHAR * name = nullptr; #ifdef FEATURE_REDHAWK typeId = RedhawkGCInterface::GetLastAllocEEType(); #else diff --git a/src/gc/objecthandle.cpp b/src/gc/objecthandle.cpp index 93cf38f..23a8d2b 100644 --- a/src/gc/objecthandle.cpp +++ b/src/gc/objecthandle.cpp @@ -1735,14 +1735,14 @@ void Ref_ScanPointers(uint32_t condemned, uint32_t maxgen, ScanContext* sc, Ref_ { HHANDLETABLE hTable = walk->pBuckets[i]->pTable[uCPUindex]; if (hTable) - HndScanHandlesForGC(hTable, &ScanPointer, LPARAM(sc), LPARAM(fn), types, _countof(types), condemned, maxgen, flags); + HndScanHandlesForGC(hTable, &ScanPointer, uintptr_t(sc), uintptr_t(fn), types, _countof(types), condemned, maxgen, flags); } } } } // enumerate pointers in variable handles whose dynamic type is VHT_WEAK_SHORT, VHT_WEAK_LONG or VHT_STRONG - TraceVariableHandlesBySingleThread(&ScanPointer, LPARAM(sc), LPARAM(fn), VHT_WEAK_SHORT | VHT_WEAK_LONG | VHT_STRONG, condemned, maxgen, flags); + TraceVariableHandlesBySingleThread(&ScanPointer, uintptr_t(sc), uintptr_t(fn), VHT_WEAK_SHORT | VHT_WEAK_LONG | VHT_STRONG, condemned, maxgen, flags); } void Ref_UpdatePinnedPointers(uint32_t condemned, uint32_t maxgen, ScanContext* sc, Ref_promote_func* fn) diff --git a/src/vm/gcenv.h b/src/vm/gcenv.h index 507c8d7..93d4185 100644 --- a/src/vm/gcenv.h +++ b/src/vm/gcenv.h @@ -133,4 +133,20 @@ public: static Thread * GetThreadList(Thread * pThread); }; -#endif // GCENV_H_ \ No newline at end of file +#define GCMemoryStatus MEMORYSTATUSEX + +#define CLR_MUTEX_COOKIE MUTEX_COOKIE + +namespace ETW +{ + typedef enum _GC_ROOT_KIND { + GC_ROOT_STACK = 0, + GC_ROOT_FQ = 1, + GC_ROOT_HANDLES = 2, + GC_ROOT_OLDER = 3, + GC_ROOT_SIZEDREF = 4, + GC_ROOT_OVERFLOW = 5 + } GC_ROOT_KIND; +}; + +#endif // GCENV_H_ -- 2.7.4