https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=0c201166f5e8bf17ce9620867d2d35a4a63e47de

commit 0c201166f5e8bf17ce9620867d2d35a4a63e47de
Author: Corinna Vinschen <[email protected]>
Date:   Sun Dec 10 14:11:41 2017 +0100

    cygwin: mmap: fix comment and formatting, drop unused code
    
    Signed-off-by: Corinna Vinschen <[email protected]>

Diff:
---
 winsup/cygwin/mmap.cc | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc
index d4eddfc..d7d480f 100644
--- a/winsup/cygwin/mmap.cc
+++ b/winsup/cygwin/mmap.cc
@@ -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,

Reply via email to