--- old/src/os/windows/vm/perfMemory_windows.cpp 2019-02-15 19:02:17.799519900 +0300 +++ new/src/os/windows/vm/perfMemory_windows.cpp 2019-02-15 19:02:17.667524521 +0300 @@ -316,9 +316,8 @@ // to determine the user name for the process id. // struct dirent* dentry; - char* tdbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(tmpdirname), mtInternal); errno = 0; - while ((dentry = os::readdir(tmpdirp, (struct dirent *)tdbuf)) != NULL) { + while ((dentry = os::readdir(tmpdirp)) != NULL) { // check if the directory entry is a hsperfdata file if (strncmp(dentry->d_name, PERFDATA_NAME, strlen(PERFDATA_NAME)) != 0) { @@ -351,9 +350,8 @@ } struct dirent* udentry; - char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name), mtInternal); errno = 0; - while ((udentry = os::readdir(subdirp, (struct dirent *)udbuf)) != NULL) { + while ((udentry = os::readdir(subdirp)) != NULL) { if (filename_to_pid(udentry->d_name) == vmid) { struct stat statbuf; @@ -405,11 +403,9 @@ } } os::closedir(subdirp); - FREE_C_HEAP_ARRAY(char, udbuf, mtInternal); FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal); } os::closedir(tmpdirp); - FREE_C_HEAP_ARRAY(char, tdbuf, mtInternal); return(latest_user); } @@ -639,9 +635,8 @@ // opendir/readdir. // struct dirent* entry; - char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal); errno = 0; - while ((entry = os::readdir(dirp, (struct dirent *)dbuf)) != NULL) { + while ((entry = os::readdir(dirp)) != NULL) { int pid = filename_to_pid(entry->d_name); @@ -682,7 +677,6 @@ errno = 0; } os::closedir(dirp); - FREE_C_HEAP_ARRAY(char, dbuf, mtInternal); } // create a file mapping object with the requested name, and size