< prev index next >
src/os/windows/vm/perfMemory_windows.cpp
Print this page
*** 314,326 ****
// open the directory and check if the file for the given vmid exists.
// The file with the expected name and the latest creation date is used
// 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) {
// check if the directory entry is a hsperfdata file
if (strncmp(dentry->d_name, PERFDATA_NAME, strlen(PERFDATA_NAME)) != 0) {
continue;
}
--- 314,325 ----
// open the directory and check if the file for the given vmid exists.
// The file with the expected name and the latest creation date is used
// to determine the user name for the process id.
//
struct dirent* dentry;
errno = 0;
! 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) {
continue;
}
*** 349,361 ****
os::closedir(subdirp);
continue;
}
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) {
if (filename_to_pid(udentry->d_name) == vmid) {
struct stat statbuf;
char* filename = NEW_C_HEAP_ARRAY(char,
--- 348,359 ----
os::closedir(subdirp);
continue;
}
struct dirent* udentry;
errno = 0;
! while ((udentry = os::readdir(subdirp)) != NULL) {
if (filename_to_pid(udentry->d_name) == vmid) {
struct stat statbuf;
char* filename = NEW_C_HEAP_ARRAY(char,
*** 403,417 ****
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
}
}
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);
}
// return the name of the user that owns the process identified by vmid.
--- 401,413 ----
*** 637,649 ****
// remove or create new files in this directory. The behavior of this
// loop under these conditions is dependent upon the implementation of
// 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) {
int pid = filename_to_pid(entry->d_name);
if (pid == 0) {
--- 633,644 ----
// remove or create new files in this directory. The behavior of this
// loop under these conditions is dependent upon the implementation of
// opendir/readdir.
//
struct dirent* entry;
errno = 0;
! while ((entry = os::readdir(dirp)) != NULL) {
int pid = filename_to_pid(entry->d_name);
if (pid == 0) {
*** 680,690 ****
remove_file(dirname, entry->d_name);
}
errno = 0;
}
os::closedir(dirp);
- FREE_C_HEAP_ARRAY(char, dbuf, mtInternal);
}
// create a file mapping object with the requested name, and size
// from the file represented by the given Handle object
//
--- 675,684 ----
< prev index next >