Support/Process: Add comments about PageSize and AllocationGranularity on Cygwin and Win32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189940 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
NAKAMURA Takumi 2013-09-04 14:12:26 +00:00
parent 81b135cc1e
commit 16eedf0ba0
2 changed files with 4 additions and 2 deletions

View 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();

View 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);
}