diff options
author | Alp Toker <alp@nuanti.com> | 2014-05-19 16:13:28 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2014-05-19 16:13:28 +0000 |
commit | d71b6dfd854f4dbff946ae22a7f4b89cbd22048e (patch) | |
tree | 57285828e98083e0aa66909a36c40af23ffca75a /llvm/lib/Support/Windows/Process.inc | |
parent | 6d8b9a747c17d900bac09c5a800f5c4b7a3c5061 (diff) | |
download | llvm-d71b6dfd854f4dbff946ae22a7f4b89cbd22048e.zip llvm-d71b6dfd854f4dbff946ae22a7f4b89cbd22048e.tar.gz llvm-d71b6dfd854f4dbff946ae22a7f4b89cbd22048e.tar.bz2 |
MemoryBuffer: Use GetNativeSystemInfo()
Removes old 4096 byte workaround. This functionality has been available since
Windows XP.
llvm-svn: 209137
Diffstat (limited to 'llvm/lib/Support/Windows/Process.inc')
-rw-r--r-- | llvm/lib/Support/Windows/Process.inc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/Support/Windows/Process.inc b/llvm/lib/Support/Windows/Process.inc index a87c9e8..c3df801 100644 --- a/llvm/lib/Support/Windows/Process.inc +++ b/llvm/lib/Support/Windows/Process.inc @@ -82,16 +82,14 @@ TimeValue self_process::get_system_time() const { return getTimeValueFromFILETIME(KernelTime); } -// This function retrieves the page size using GetSystemInfo and is present -// solely so it can be called once to initialize the self_process member below. +// This function retrieves the page size using GetNativeSystemInfo() and is +// present solely so it can be called once to initialize the self_process member +// below. static unsigned getPageSize() { - // NOTE: A 32-bit application running under WOW64 is supposed to use - // GetNativeSystemInfo. However, this interface is not present prior - // to Windows XP so to use it requires dynamic linking. It is not clear - // how this affects the reported page size, if at all. One could argue - // that LLVM ought to run as 64-bits on a 64-bit system, anyway. + // GetNativeSystemInfo() provides the physical page size which may differ + // from GetSystemInfo() in 32-bit applications running under WOW64. SYSTEM_INFO info; - GetSystemInfo(&info); + GetNativeSystemInfo(&info); // FIXME: FileOffset in MapViewOfFile() should be aligned to not dwPageSize, // but dwAllocationGranularity. return static_cast<unsigned>(info.dwPageSize); |