src/hotspot/os/windows/os_windows.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File open Sdiff src/hotspot/os/windows

src/hotspot/os/windows/os_windows.cpp

Print this page




 703 
 704 julong os::physical_memory() {
 705   return win32::physical_memory();
 706 }
 707 
 708 bool os::has_allocatable_memory_limit(julong* limit) {
 709   MEMORYSTATUSEX ms;
 710   ms.dwLength = sizeof(ms);
 711   GlobalMemoryStatusEx(&ms);
 712 #ifdef _LP64
 713   *limit = (julong)ms.ullAvailVirtual;
 714   return true;
 715 #else
 716   // Limit to 1400m because of the 2gb address space wall
 717   *limit = MIN2((julong)1400*M, (julong)ms.ullAvailVirtual);
 718   return true;
 719 #endif
 720 }
 721 
 722 int os::active_processor_count() {








 723   DWORD_PTR lpProcessAffinityMask = 0;
 724   DWORD_PTR lpSystemAffinityMask = 0;
 725   int proc_count = processor_count();
 726   if (proc_count <= sizeof(UINT_PTR) * BitsPerByte &&
 727       GetProcessAffinityMask(GetCurrentProcess(), &lpProcessAffinityMask, &lpSystemAffinityMask)) {
 728     // Nof active processors is number of bits in process affinity mask
 729     int bitcount = 0;
 730     while (lpProcessAffinityMask != 0) {
 731       lpProcessAffinityMask = lpProcessAffinityMask & (lpProcessAffinityMask-1);
 732       bitcount++;
 733     }
 734     return bitcount;
 735   } else {
 736     return proc_count;
 737   }
 738 }
 739 
 740 void os::set_native_thread_name(const char *name) {
 741 
 742   // See: http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx




 703 
 704 julong os::physical_memory() {
 705   return win32::physical_memory();
 706 }
 707 
 708 bool os::has_allocatable_memory_limit(julong* limit) {
 709   MEMORYSTATUSEX ms;
 710   ms.dwLength = sizeof(ms);
 711   GlobalMemoryStatusEx(&ms);
 712 #ifdef _LP64
 713   *limit = (julong)ms.ullAvailVirtual;
 714   return true;
 715 #else
 716   // Limit to 1400m because of the 2gb address space wall
 717   *limit = MIN2((julong)1400*M, (julong)ms.ullAvailVirtual);
 718   return true;
 719 #endif
 720 }
 721 
 722 int os::active_processor_count() {
 723   // User has overridden the number of active processors
 724   if (ActiveProcessorCount > 0) {
 725     log_trace(os)("active_processor_count: "
 726                   "active processor count set by user : %d",
 727                   ActiveProcessorCount);
 728     return ActiveProcessorCount;
 729   }
 730 
 731   DWORD_PTR lpProcessAffinityMask = 0;
 732   DWORD_PTR lpSystemAffinityMask = 0;
 733   int proc_count = processor_count();
 734   if (proc_count <= sizeof(UINT_PTR) * BitsPerByte &&
 735       GetProcessAffinityMask(GetCurrentProcess(), &lpProcessAffinityMask, &lpSystemAffinityMask)) {
 736     // Nof active processors is number of bits in process affinity mask
 737     int bitcount = 0;
 738     while (lpProcessAffinityMask != 0) {
 739       lpProcessAffinityMask = lpProcessAffinityMask & (lpProcessAffinityMask-1);
 740       bitcount++;
 741     }
 742     return bitcount;
 743   } else {
 744     return proc_count;
 745   }
 746 }
 747 
 748 void os::set_native_thread_name(const char *name) {
 749 
 750   // See: http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx


src/hotspot/os/windows/os_windows.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File