MemoryBuffer: Use GetNativeSystemInfo()

Removes old 4096 byte workaround. This functionality has been available since
Windows XP.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209137 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alp Toker
2014-05-19 16:13:28 +00:00
parent b90ef82eb4
commit c933013858
2 changed files with 6 additions and 17 deletions

View File

@@ -310,15 +310,6 @@ static bool shouldUseMmap(int FD,
if (End != FileSize)
return false;
#if defined(_WIN32) || defined(__CYGWIN__)
// Don't peek the next page if file is multiple of *physical* pagesize(4k)
// but is not multiple of AllocationGranularity(64k),
// when a null terminator is required.
// FIXME: It's not good to hardcode 4096 here. dwPageSize shows 4096.
if ((FileSize & (4096 - 1)) == 0)
return false;
#endif
// Don't try to map files that are exactly a multiple of the system page size
// if we need a null terminator.
if ((FileSize & (PageSize -1)) == 0)