< prev index next >

src/os/windows/vm/os_windows.cpp

Print this page




 136     if (ForceTimeHighResolution) {
 137       timeEndPeriod(1L);
 138     }
 139     break;
 140   default:
 141     break;
 142   }
 143   return true;
 144 }
 145 
 146 static inline double fileTimeAsDouble(FILETIME* time) {
 147   const double high  = (double) ((unsigned int) ~0);
 148   const double split = 10000000.0;
 149   double result = (time->dwLowDateTime / split) +
 150                    time->dwHighDateTime * (high/split);
 151   return result;
 152 }
 153 
 154 // Implementation of os
 155 
 156 bool os::getenv(const char* name, char* buffer, int len) {
 157   int result = GetEnvironmentVariable(name, buffer, len);
 158   return result > 0 && result < len;
 159 }
 160 
 161 bool os::unsetenv(const char* name) {
 162   assert(name != NULL, "Null pointer");
 163   return (SetEnvironmentVariable(name, NULL) == TRUE);
 164 }
 165 
 166 // No setuid programs under Windows.
 167 bool os::have_special_privileges() {
 168   return false;
 169 }
 170 
 171 
 172 // This method is  a periodic task to check for misbehaving JNI applications
 173 // under CheckJNI, we can add any periodic checks here.
 174 // For Windows at the moment does nothing
 175 void os::run_periodic_checks() {
 176   return;
 177 }
 178 
 179 // previous UnhandledExceptionFilter, if there is one
 180 static LPTOP_LEVEL_EXCEPTION_FILTER prev_uef_handler = NULL;


5913     if (actual_location == NULL) {
5914       if (VerboseInternalVMTests) {
5915         gclog_or_tty->print("Failed to allocate any memory at "PTR_FORMAT" size "SIZE_FORMAT". Skipping remainder of test.",
5916                             expected_location, large_allocation_size);
5917       }
5918     } else {
5919       // release memory
5920       os::release_memory_special(actual_location, expected_allocation_size);
5921       // only now check, after releasing any memory to avoid any leaks.
5922       assert(actual_location == expected_location,
5923              err_msg("Failed to allocate memory at requested location "PTR_FORMAT" of size "SIZE_FORMAT", is "PTR_FORMAT" instead",
5924              expected_location, expected_allocation_size, actual_location));
5925     }
5926   }
5927 
5928   // restore globals
5929   UseLargePagesIndividualAllocation = old_use_large_pages_individual_allocation;
5930   UseNUMAInterleaving = old_use_numa_interleaving;
5931 }
5932 #endif // PRODUCT
5933 


 136     if (ForceTimeHighResolution) {
 137       timeEndPeriod(1L);
 138     }
 139     break;
 140   default:
 141     break;
 142   }
 143   return true;
 144 }
 145 
 146 static inline double fileTimeAsDouble(FILETIME* time) {
 147   const double high  = (double) ((unsigned int) ~0);
 148   const double split = 10000000.0;
 149   double result = (time->dwLowDateTime / split) +
 150                    time->dwHighDateTime * (high/split);
 151   return result;
 152 }
 153 
 154 // Implementation of os
 155 





 156 bool os::unsetenv(const char* name) {
 157   assert(name != NULL, "Null pointer");
 158   return (SetEnvironmentVariable(name, NULL) == TRUE);
 159 }
 160 
 161 // No setuid programs under Windows.
 162 bool os::have_special_privileges() {
 163   return false;
 164 }
 165 
 166 
 167 // This method is  a periodic task to check for misbehaving JNI applications
 168 // under CheckJNI, we can add any periodic checks here.
 169 // For Windows at the moment does nothing
 170 void os::run_periodic_checks() {
 171   return;
 172 }
 173 
 174 // previous UnhandledExceptionFilter, if there is one
 175 static LPTOP_LEVEL_EXCEPTION_FILTER prev_uef_handler = NULL;


5908     if (actual_location == NULL) {
5909       if (VerboseInternalVMTests) {
5910         gclog_or_tty->print("Failed to allocate any memory at "PTR_FORMAT" size "SIZE_FORMAT". Skipping remainder of test.",
5911                             expected_location, large_allocation_size);
5912       }
5913     } else {
5914       // release memory
5915       os::release_memory_special(actual_location, expected_allocation_size);
5916       // only now check, after releasing any memory to avoid any leaks.
5917       assert(actual_location == expected_location,
5918              err_msg("Failed to allocate memory at requested location "PTR_FORMAT" of size "SIZE_FORMAT", is "PTR_FORMAT" instead",
5919              expected_location, expected_allocation_size, actual_location));
5920     }
5921   }
5922 
5923   // restore globals
5924   UseLargePagesIndividualAllocation = old_use_large_pages_individual_allocation;
5925   UseNUMAInterleaving = old_use_numa_interleaving;
5926 }
5927 #endif // PRODUCT

< prev index next >