src/hotspot/os/windows/os_windows.cpp
changeset 54573 b73893f7fee3
parent 54485 ddc19ea5059c
child 54621 0b6dc5b93306
equal deleted inserted replaced
54572:75a42622414e 54573:b73893f7fee3
  4998 // Remap a block of memory.
  4998 // Remap a block of memory.
  4999 char* os::pd_remap_memory(int fd, const char* file_name, size_t file_offset,
  4999 char* os::pd_remap_memory(int fd, const char* file_name, size_t file_offset,
  5000                           char *addr, size_t bytes, bool read_only,
  5000                           char *addr, size_t bytes, bool read_only,
  5001                           bool allow_exec) {
  5001                           bool allow_exec) {
  5002   // This OS does not allow existing memory maps to be remapped so we
  5002   // This OS does not allow existing memory maps to be remapped so we
  5003   // have to unmap the memory before we remap it.
  5003   // would have to unmap the memory before we remap it.
  5004   if (!os::unmap_memory(addr, bytes)) {
  5004 
  5005     return NULL;
  5005   // Because there is a small window between unmapping memory and mapping
  5006   }
  5006   // it in again with different protections, CDS archives are mapped RW
  5007 
  5007   // on windows, so this function isn't called.
  5008   // There is a very small theoretical window between the unmap_memory()
  5008   ShouldNotReachHere();
  5009   // call above and the map_memory() call below where a thread in native
  5009   return NULL;
  5010   // code may be able to access an address that is no longer mapped.
       
  5011 
       
  5012   return os::map_memory(fd, file_name, file_offset, addr, bytes,
       
  5013                         read_only, allow_exec);
       
  5014 }
  5010 }
  5015 
  5011 
  5016 
  5012 
  5017 // Unmap a block of memory.
  5013 // Unmap a block of memory.
  5018 // Returns true=success, otherwise false.
  5014 // Returns true=success, otherwise false.