Support/Process: Add comments about PageSize and AllocationGranularity on Cygwin...
authorNAKAMURA Takumi <geek4civic@gmail.com>
Wed, 4 Sep 2013 14:12:26 +0000 (14:12 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Wed, 4 Sep 2013 14:12:26 +0000 (14:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189940 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Unix/Process.inc
lib/Support/Windows/Process.inc

index cd244f69e746e2d36d65a19c0f63cbf87bdd13fa..47d0a3c794d4d4fdb337286debcda08f50bd54ce 100644 (file)
@@ -88,8 +88,8 @@ TimeValue self_process::get_system_time() const {
   return getRUsageTimes().second;
 }
 
-// On Cygwin, getpagesize() returns 64k and offset in mmap(3) should be
-// aligned to its pagesize.
+// On Cygwin, getpagesize() returns 64k(AllocationGranularity) and
+// offset in mmap(3) should be aligned to the AllocationGranularity.
 static unsigned getPageSize() {
 #if defined(HAVE_GETPAGESIZE)
   const int page_size = ::getpagesize();
index 38d5bc7e11947720c8eccb1e9aa24807c48e1e33..f840d064d8d10b81920350e1f9676486db366ee9 100644 (file)
@@ -83,6 +83,8 @@ static unsigned getPageSize() {
   // that LLVM ought to run as 64-bits on a 64-bit system, anyway.
   SYSTEM_INFO info;
   GetSystemInfo(&info);
+  // FIXME: FileOffset in MapViewOfFile() should be aligned to not dwPageSize,
+  // but dwAllocationGranularity.
   return static_cast<unsigned>(info.dwPageSize);
 }