summaryrefslogtreecommitdiff
path: root/src/gc/env/gcenv.base.h
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2015-12-03 13:48:29 -0800
committerJan Kotas <jkotas@microsoft.com>2015-12-03 13:48:29 -0800
commitfda07d5e1ef6c177a539a639f2b92473a35fc0be (patch)
treeb5f0b6fccd01e4e1f688939b447ff6a64e07905f /src/gc/env/gcenv.base.h
parentcfb1a0b47dd2e352413302755bca1c1d09e072d2 (diff)
downloadcoreclr-fda07d5e1ef6c177a539a639f2b92473a35fc0be.tar.gz
coreclr-fda07d5e1ef6c177a539a639f2b92473a35fc0be.tar.bz2
coreclr-fda07d5e1ef6c177a539a639f2b92473a35fc0be.zip
Update GC from CoreRT
https://github.com/dotnet/corert/tree/master/src/Native/gc 17232964a899c5403abbef1ab022f6d161f8b9ff
Diffstat (limited to 'src/gc/env/gcenv.base.h')
-rw-r--r--src/gc/env/gcenv.base.h76
1 files changed, 13 insertions, 63 deletions
diff --git a/src/gc/env/gcenv.base.h b/src/gc/env/gcenv.base.h
index 72b74bd14d..57fbb0460b 100644
--- a/src/gc/env/gcenv.base.h
+++ b/src/gc/env/gcenv.base.h
@@ -32,6 +32,7 @@ typedef uint32_t BOOL;
typedef uint32_t DWORD;
typedef void* LPVOID;
typedef uint32_t UINT;
+typedef int32_t LONG;
typedef uintptr_t ULONG_PTR;
typedef void VOID;
typedef void* PVOID;
@@ -43,19 +44,6 @@ typedef size_t SIZE_T;
typedef void * HANDLE;
-typedef union _LARGE_INTEGER {
- struct {
-#if BIGENDIAN
- int32_t HighPart;
- uint32_t LowPart;
-#else
- uint32_t LowPart;
- int32_t HighPart;
-#endif
- } u;
- int64_t QuadPart;
-} LARGE_INTEGER, *PLARGE_INTEGER;
-
#define SIZE_T_MAX ((size_t)-1)
#define SSIZE_T_MAX ((ptrdiff_t)(SIZE_T_MAX / 2))
@@ -121,35 +109,6 @@ inline HRESULT HRESULT_FROM_WIN32(unsigned long x)
#define sprintf_s snprintf
#endif
-#ifdef WIN32
-
-#pragma pack(push, 8)
-
-typedef struct _RTL_CRITICAL_SECTION {
- void* DebugInfo;
-
- //
- // The following three fields control entering and exiting the critical
- // section for the resource
- //
-
- int32_t LockCount;
- int32_t RecursionCount;
- HANDLE OwningThread; // from the thread's ClientId->UniqueThread
- HANDLE LockSemaphore;
- uintptr_t SpinCount; // force size on 64-bit systems when packed
-} CRITICAL_SECTION, RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION;
-
-#pragma pack(pop)
-
-#else
-
-typedef struct _RTL_CRITICAL_SECTION {
- pthread_mutex_t mutex;
-} CRITICAL_SECTION, RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION;
-
-#endif
-
#define WINBASEAPI extern "C"
#define WINAPI __stdcall
@@ -552,6 +511,18 @@ T VolatileLoad(T const * pt)
return val;
}
+template<typename T>
+inline
+T VolatileLoadWithoutBarrier(T const * pt)
+{
+#ifndef DACCESS_COMPILE
+ T val = *(T volatile const *)pt;
+#else
+ T val = *pt;
+#endif
+ return val;
+}
+
//
// VolatileStore stores a T into the target of a pointer to T. Is is guaranteed that this store will
// not be optimized away by the compiler, and that any operation that occurs before this store, in program
@@ -567,30 +538,9 @@ void VolatileStore(T* pt, T val)
*(T volatile *)pt = val;
}
-struct GCSystemInfo
-{
- DWORD dwNumberOfProcessors;
- DWORD dwPageSize;
- DWORD dwAllocationGranularity;
-};
-
extern GCSystemInfo g_SystemInfo;
void InitializeSystemInfo();
-// An 'abstract' definition of Windows MEMORYSTATUSEX. In practice, the only difference is the missing struct size
-// field and one field that Windows documents to always be 0. If additional information is available on other OSes,
-// this information should be surfaced through this structure as additional fields that the GC may optionally depend on.
-struct GCMemoryStatus
-{
- uint32_t dwMemoryLoad;
- uint64_t ullTotalPhys;
- uint64_t ullAvailPhys;
- uint64_t ullTotalPageFile;
- uint64_t ullAvailPageFile;
- uint64_t ullTotalVirtual;
- uint64_t ullAvailVirtual;
-};
-
void
GetProcessMemoryLoad(
GCMemoryStatus* lpBuffer);