changeset 10560:47a9289d9b0b

8151414: os::pretouch_memory should take void* instead of char* Summary: Change parameters and remove associated casts. Reviewed-by: pliden, stefank
author tschatzl
date Wed, 09 Mar 2016 09:56:10 +0100
parents 2d1f1d4c0379
children 51330f8324b6 189efe045210
files src/share/vm/gc/parallel/mutableSpace.cpp src/share/vm/runtime/os.cpp src/share/vm/runtime/os.hpp
diffstat 3 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc/parallel/mutableSpace.cpp	Wed Mar 09 09:45:47 2016 +0100
+++ b/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/src/share/vm/runtime/os.cpp	Wed Mar 09 09:45:47 2016 +0100
+++ b/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/src/share/vm/runtime/os.hpp	Wed Mar 09 09:45:47 2016 +0100
+++ b/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,