Merge
authorkevinw
Wed, 16 Mar 2016 12:08:29 +0000
changeset 37119 495af04bfea6
parent 37116 ad6eb2d954b9 (current diff)
parent 37118 42d3dc23603e (diff)
child 37121 373b0cfbfd4b
child 37124 3d6e0ad0dbfb
child 37126 ed3f8d81d85c
Merge
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp	Wed Mar 16 10:28:57 2016 +0100
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp	Wed Mar 16 12:08:29 2016 +0000
@@ -1898,7 +1898,7 @@
   int fd = ::open("/proc/self/map",O_RDONLY);
   if (fd >= 0) {
     prmap_t *p = NULL;
-    char *mbuff = (char *) calloc(read_chunk, sizeof(prmap_t) + 1);
+    char *mbuff = (char *) calloc(read_chunk, sizeof(prmap_t));
     if (NULL == mbuff) {
       ::close(fd);
       return status;
@@ -1912,7 +1912,7 @@
       p = (prmap_t *)mbuff;
       for(int i = 0; i < nmap; i++){
         if (p->pr_vaddr == 0x0) {
-          st->print("Warning: Address: " PTR_FORMAT ", Size: %dK, ",p->pr_vaddr, p->pr_size/1024);
+          st->print("Warning: Address: " PTR_FORMAT ", Size: " SIZE_FORMAT "K, ",p->pr_vaddr, p->pr_size/1024);
           st->print("Mapped file: %s, ", p->pr_mapname[0] == '\0' ? "None" : p->pr_mapname);
           st->print("Access: ");
           st->print("%s",(p->pr_mflags & MA_READ)  ? "r" : "-");
@@ -1921,13 +1921,12 @@
           st->cr();
           status = true;
         }
-        p = (prmap_t *)(mbuff + sizeof(prmap_t));
+        p++;
       }
-      memset(mbuff, 0, read_chunk*sizeof(prmap_t)+1);
     }
     free(mbuff);
-  }
-  ::close(fd);
+    ::close(fd);
+  }
   return status;
 }