[llvm] r189940 - Support/Process: Add comments about PageSize and AllocationGranularity on Cygwin and Win32.
NAKAMURA Takumi
geek4civic at gmail.com
Wed Sep 4 07:12:26 PDT 2013
Author: chapuni
Date: Wed Sep 4 09:12:26 2013
New Revision: 189940
URL: http://llvm.org/viewvc/llvm-project?rev=189940&view=rev
Log:
Support/Process: Add comments about PageSize and AllocationGranularity on Cygwin and Win32.
Modified:
llvm/trunk/lib/Support/Unix/Process.inc
llvm/trunk/lib/Support/Windows/Process.inc
Modified: llvm/trunk/lib/Support/Unix/Process.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Process.inc?rev=189940&r1=189939&r2=189940&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Process.inc (original)
+++ llvm/trunk/lib/Support/Unix/Process.inc Wed Sep 4 09:12:26 2013
@@ -88,8 +88,8 @@ TimeValue self_process::get_system_time(
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();
Modified: llvm/trunk/lib/Support/Windows/Process.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Process.inc?rev=189940&r1=189939&r2=189940&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/Process.inc (original)
+++ llvm/trunk/lib/Support/Windows/Process.inc Wed Sep 4 09:12:26 2013
@@ -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);
}
More information about the llvm-commits
mailing list