hotspot/src/os/windows/vm/perfMemory_windows.cpp
changeset 35212 7a6d0993a080
parent 27880 afb974a04396
child 36204 1c9f2970da66
equal deleted inserted replaced
35209:b2f409087683 35212:7a6d0993a080
  1306   // Create the file - the FILE_FLAG_DELETE_ON_CLOSE flag allows the
  1306   // Create the file - the FILE_FLAG_DELETE_ON_CLOSE flag allows the
  1307   // file to be deleted by the last process that closes its handle to
  1307   // file to be deleted by the last process that closes its handle to
  1308   // the file. This is important as the apis do not allow a terminating
  1308   // the file. This is important as the apis do not allow a terminating
  1309   // JVM being monitored by another process to remove the file name.
  1309   // JVM being monitored by another process to remove the file name.
  1310   //
  1310   //
  1311   // the FILE_SHARE_DELETE share mode is valid only in winnt
       
  1312   //
       
  1313   fh = CreateFile(
  1311   fh = CreateFile(
  1314              filename,                   /* LPCTSTR file name */
  1312              filename,                          /* LPCTSTR file name */
  1315 
  1313 
  1316              GENERIC_READ|GENERIC_WRITE, /* DWORD desired access */
  1314              GENERIC_READ|GENERIC_WRITE,        /* DWORD desired access */
  1317 
  1315              FILE_SHARE_DELETE|FILE_SHARE_READ, /* DWORD share mode, future READONLY
  1318              (os::win32::is_nt() ? FILE_SHARE_DELETE : 0)|
  1316                                                  * open operations allowed
  1319              FILE_SHARE_READ,            /* DWORD share mode, future READONLY
  1317                                                  */
  1320                                           * open operations allowed
  1318              lpFileSA,                          /* LPSECURITY security attributes */
  1321                                           */
  1319              CREATE_ALWAYS,                     /* DWORD creation disposition
  1322              lpFileSA,                   /* LPSECURITY security attributes */
  1320                                                  * create file, if it already
  1323              CREATE_ALWAYS,              /* DWORD creation disposition
  1321                                                  * exists, overwrite it.
  1324                                           * create file, if it already
  1322                                                  */
  1325                                           * exists, overwrite it.
  1323              FILE_FLAG_DELETE_ON_CLOSE,         /* DWORD flags and attributes */
  1326                                           */
  1324 
  1327              FILE_FLAG_DELETE_ON_CLOSE,  /* DWORD flags and attributes */
  1325              NULL);                             /* HANDLE template file access */
  1328 
       
  1329              NULL);                      /* HANDLE template file access */
       
  1330 
  1326 
  1331   free_security_attr(lpFileSA);
  1327   free_security_attr(lpFileSA);
  1332 
  1328 
  1333   if (fh == INVALID_HANDLE_VALUE) {
  1329   if (fh == INVALID_HANDLE_VALUE) {
  1334     DWORD lasterror = GetLastError();
  1330     DWORD lasterror = GetLastError();
  1732 // data for the JVM. The memory may be created in standard or
  1728 // data for the JVM. The memory may be created in standard or
  1733 // shared memory.
  1729 // shared memory.
  1734 //
  1730 //
  1735 void PerfMemory::create_memory_region(size_t size) {
  1731 void PerfMemory::create_memory_region(size_t size) {
  1736 
  1732 
  1737   if (PerfDisableSharedMem || !os::win32::is_nt()) {
  1733   if (PerfDisableSharedMem) {
  1738     // do not share the memory for the performance data.
  1734     // do not share the memory for the performance data.
  1739     PerfDisableSharedMem = true;
  1735     PerfDisableSharedMem = true;
  1740     _start = create_standard_memory(size);
  1736     _start = create_standard_memory(size);
  1741   }
  1737   }
  1742   else {
  1738   else {