8151414: os::pretouch_memory should take void* instead of char*
authortschatzl
Wed, 09 Mar 2016 09:56:10 +0100
changeset 37046 88fbf4e7b9c6
parent 37045 41e3f98fa3dc
child 37047 ba4d0448cc09
child 37048 6076d323626d
8151414: os::pretouch_memory should take void* instead of char* Summary: Change parameters and remove associated casts. Reviewed-by: pliden, stefank
hotspot/src/share/vm/gc/parallel/mutableSpace.cpp
hotspot/src/share/vm/runtime/os.cpp
hotspot/src/share/vm/runtime/os.hpp
--- a/hotspot/src/share/vm/gc/parallel/mutableSpace.cpp	Wed Mar 09 09:45:47 2016 +0100
+++ b/hotspot/src/share/vm/gc/parallel/mutableSpace.cpp	Wed Mar 09 09:56:10 2016 +0100
@@ -58,7 +58,7 @@
 }
 
 void MutableSpace::pretouch_pages(MemRegion mr) {
-  os::pretouch_memory((char*)mr.start(), (char*)mr.end());
+  os::pretouch_memory(mr.start(), mr.end());
 }
 
 void MutableSpace::initialize(MemRegion mr,
--- a/hotspot/src/share/vm/runtime/os.cpp	Wed Mar 09 09:45:47 2016 +0100
+++ b/hotspot/src/share/vm/runtime/os.cpp	Wed Mar 09 09:56:10 2016 +0100
@@ -1600,8 +1600,8 @@
   return res;
 }
 
-void os::pretouch_memory(char* start, char* end) {
-  for (volatile char *p = start; p < end; p += os::vm_page_size()) {
+void os::pretouch_memory(void* start, void* end) {
+  for (volatile char *p = (char*)start; p < (char*)end; p += os::vm_page_size()) {
     *p = 0;
   }
 }
--- a/hotspot/src/share/vm/runtime/os.hpp	Wed Mar 09 09:45:47 2016 +0100
+++ b/hotspot/src/share/vm/runtime/os.hpp	Wed Mar 09 09:56:10 2016 +0100
@@ -325,7 +325,7 @@
   // to make the OS back the memory range with actual memory.
   // Current implementation may not touch the last page if unaligned addresses
   // are passed.
-  static void   pretouch_memory(char* start, char* end);
+  static void   pretouch_memory(void* start, void* end);
 
   enum ProtType { MEM_PROT_NONE, MEM_PROT_READ, MEM_PROT_RW, MEM_PROT_RWX };
   static bool   protect_memory(char* addr, size_t bytes, ProtType prot,