src/os/aix/vm/perfMemory_aix.cpp

changeset 9711
0f2fe7d37d8c
parent 9507
7e72702243a4
     1.1 --- a/src/os/aix/vm/perfMemory_aix.cpp	Tue Apr 30 14:49:19 2019 +0200
     1.2 +++ b/src/os/aix/vm/perfMemory_aix.cpp	Mon Jun 17 16:41:38 2019 +0100
     1.3 @@ -612,9 +612,8 @@
     1.4    // to determine the user name for the process id.
     1.5    //
     1.6    struct dirent* dentry;
     1.7 -  char* tdbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(tmpdirname), mtInternal);
     1.8    errno = 0;
     1.9 -  while ((dentry = os::readdir(tmpdirp, (struct dirent *)tdbuf)) != NULL) {
    1.10 +  while ((dentry = os::readdir(tmpdirp)) != NULL) {
    1.11  
    1.12      // check if the directory entry is a hsperfdata file
    1.13      if (strncmp(dentry->d_name, PERFDATA_NAME, strlen(PERFDATA_NAME)) != 0) {
    1.14 @@ -648,9 +647,8 @@
    1.15      }
    1.16  
    1.17      struct dirent* udentry;
    1.18 -    char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name), mtInternal);
    1.19      errno = 0;
    1.20 -    while ((udentry = os::readdir(subdirp, (struct dirent *)udbuf)) != NULL) {
    1.21 +    while ((udentry = os::readdir(subdirp)) != NULL) {
    1.22  
    1.23        if (filename_to_pid(udentry->d_name) == vmid) {
    1.24          struct stat statbuf;
    1.25 @@ -694,11 +692,9 @@
    1.26        }
    1.27      }
    1.28      os::closedir(subdirp);
    1.29 -    FREE_C_HEAP_ARRAY(char, udbuf, mtInternal);
    1.30      FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
    1.31    }
    1.32    os::closedir(tmpdirp);
    1.33 -  FREE_C_HEAP_ARRAY(char, tdbuf, mtInternal);
    1.34  
    1.35    return(oldest_user);
    1.36  }
    1.37 @@ -774,10 +770,8 @@
    1.38    // loop under these conditions is dependent upon the implementation of
    1.39    // opendir/readdir.
    1.40    struct dirent* entry;
    1.41 -  char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal);
    1.42 -
    1.43    errno = 0;
    1.44 -  while ((entry = os::readdir(dirp, (struct dirent *)dbuf)) != NULL) {
    1.45 +  while ((entry = os::readdir(dirp)) != NULL) {
    1.46  
    1.47      pid_t pid = filename_to_pid(entry->d_name);
    1.48  
    1.49 @@ -816,7 +810,6 @@
    1.50    // Close the directory and reset the current working directory.
    1.51    close_directory_secure_cwd(dirp, saved_cwd_fd);
    1.52  
    1.53 -  FREE_C_HEAP_ARRAY(char, dbuf, mtInternal);
    1.54  }
    1.55  
    1.56  // Make the user specific temporary directory. Returns true if

mercurial