diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-08-22 10:23:52 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-08-22 10:23:52 +0000 |
commit | 26c8ea657f3e792e17e1dd35fe79489e36958832 (patch) | |
tree | 38570dad80a1828b67546b079fafc50aabdbc1b9 /llvm/lib/Support | |
parent | 6b795f12c4c9bf620c7c3ae291a36cff50af4c2a (diff) | |
download | bcm5719-llvm-26c8ea657f3e792e17e1dd35fe79489e36958832.tar.gz bcm5719-llvm-26c8ea657f3e792e17e1dd35fe79489e36958832.zip |
MemoryBuffer.cpp: Consider if PageSize were not 4096 in shouldUseMmap(). Follow-up to r188903.
The AllocationGranularity can be 65536 on Win32, even on Cygwin.
llvm-svn: 188998
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r-- | llvm/lib/Support/MemoryBuffer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/MemoryBuffer.cpp b/llvm/lib/Support/MemoryBuffer.cpp index cab45c736b5..1c45c69ff3f 100644 --- a/llvm/lib/Support/MemoryBuffer.cpp +++ b/llvm/lib/Support/MemoryBuffer.cpp @@ -276,7 +276,7 @@ static bool shouldUseMmap(int FD, int PageSize) { // We don't use mmap for small files because this can severely fragment our // address space. - if (MapSize < 4096*4) + if (MapSize < 4 * 4096 || MapSize < (unsigned)PageSize) return false; if (!RequiresNullTerminator) |