cygwin: mmap: fix comment and formatting, drop unused code

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2017-12-10 14:11:41 +01:00
parent 67a657cb1d
commit 0c201166f5
1 changed files with 5 additions and 8 deletions

View File

@ -1177,12 +1177,9 @@ go_ahead:
protection as the file's pages, then as much pages as necessary
to accomodate the requested length, but as reserved pages which
raise a SIGBUS when trying to access them. AT_ROUND_TO_PAGE
and page protection on shared pages is only supported by 32 bit NT,
so don't even try on WOW64. This is accomplished by not setting
orig_len on WOW64 above. */
#if 0
orig_len = roundup2 (orig_len, pagesize);
#endif
and page protection on shared pages is only supported by the
32 bit environment, so don't even try on 64 bit or even WOW64.
This is accomplished by not setting orig_len on 64 bit above. */
len = roundup2 (len, wincap.page_size ());
if (orig_len - len)
{
@ -1465,7 +1462,7 @@ mlock (const void *addr, size_t len)
/* Align address and length values to page size. */
size_t pagesize = wincap.allocation_granularity ();
PVOID base = (PVOID) rounddown((uintptr_t) addr, pagesize);
PVOID base = (PVOID) rounddown ((uintptr_t) addr, pagesize);
SIZE_T size = roundup2 (((uintptr_t) addr - (uintptr_t) base) + len,
pagesize);
NTSTATUS status = 0;
@ -1523,7 +1520,7 @@ munlock (const void *addr, size_t len)
/* Align address and length values to page size. */
size_t pagesize = wincap.allocation_granularity ();
PVOID base = (PVOID) rounddown((uintptr_t) addr, pagesize);
PVOID base = (PVOID) rounddown ((uintptr_t) addr, pagesize);
SIZE_T size = roundup2 (((uintptr_t) addr - (uintptr_t) base) + len,
pagesize);
NTSTATUS status = NtUnlockVirtualMemory (NtCurrentProcess (), &base, &size,