changeset 10633:7ccf7f03a914

Merge
author kevinw
date Wed, 16 Mar 2016 12:08:29 +0000
parents c4b391039f9f 37c777f2cc9c
children 9d93b077b22f f1e1cfbb6d2c 785a498ee1ea
files
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/os/solaris/vm/os_solaris.cpp	Wed Mar 16 10:28:57 2016 +0100
+++ b/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;
 }