src/hotspot/os/windows/os_windows.cpp
changeset 54573 b73893f7fee3
parent 54485 ddc19ea5059c
child 54621 0b6dc5b93306
--- a/src/hotspot/os/windows/os_windows.cpp	Fri Apr 12 09:13:50 2019 +0200
+++ b/src/hotspot/os/windows/os_windows.cpp	Thu Apr 18 07:02:07 2019 -0400
@@ -5000,17 +5000,13 @@
                           char *addr, size_t bytes, bool read_only,
                           bool allow_exec) {
   // This OS does not allow existing memory maps to be remapped so we
-  // have to unmap the memory before we remap it.
-  if (!os::unmap_memory(addr, bytes)) {
-    return NULL;
-  }
-
-  // There is a very small theoretical window between the unmap_memory()
-  // call above and the map_memory() call below where a thread in native
-  // code may be able to access an address that is no longer mapped.
-
-  return os::map_memory(fd, file_name, file_offset, addr, bytes,
-                        read_only, allow_exec);
+  // would have to unmap the memory before we remap it.
+
+  // Because there is a small window between unmapping memory and mapping
+  // it in again with different protections, CDS archives are mapped RW
+  // on windows, so this function isn't called.
+  ShouldNotReachHere();
+  return NULL;
 }