< prev index next >
src/os/windows/vm/os_windows.cpp
Print this page
*** 821,831 ****
java_origin.wMinute = 0;
java_origin.wSecond = 0;
java_origin.wMilliseconds = 0;
FILETIME jot;
if (!SystemTimeToFileTime(&java_origin, &jot)) {
! fatal(err_msg("Error = %d\nWindows error", GetLastError()));
}
_calculated_offset = jlong_from(jot.dwHighDateTime, jot.dwLowDateTime);
_has_calculated_offset = 1;
assert(_calculated_offset == _offset, "Calculated and constant time offsets must be equal");
return _calculated_offset;
--- 821,831 ----
java_origin.wMinute = 0;
java_origin.wSecond = 0;
java_origin.wMilliseconds = 0;
FILETIME jot;
if (!SystemTimeToFileTime(&java_origin, &jot)) {
! fatal("Error = %d\nWindows error", GetLastError());
}
_calculated_offset = jlong_from(jot.dwHighDateTime, jot.dwLowDateTime);
_has_calculated_offset = 1;
assert(_calculated_offset == _offset, "Calculated and constant time offsets must be equal");
return _calculated_offset;
*** 1934,1962 ****
}
WindowsSemaphore::WindowsSemaphore(uint value) {
_semaphore = ::CreateSemaphore(NULL, value, LONG_MAX, NULL);
! guarantee(_semaphore != NULL, err_msg("CreateSemaphore failed with error code: %lu", GetLastError()));
}
WindowsSemaphore::~WindowsSemaphore() {
::CloseHandle(_semaphore);
}
void WindowsSemaphore::signal(uint count) {
if (count > 0) {
BOOL ret = ::ReleaseSemaphore(_semaphore, count, NULL);
! assert(ret != 0, err_msg("ReleaseSemaphore failed with error code: %lu", GetLastError()));
}
}
void WindowsSemaphore::wait() {
DWORD ret = ::WaitForSingleObject(_semaphore, INFINITE);
! assert(ret != WAIT_FAILED, err_msg("WaitForSingleObject failed with error code: %lu", GetLastError()));
! assert(ret == WAIT_OBJECT_0, err_msg("WaitForSingleObject failed with return value: %lu", ret));
}
// sun.misc.Signal
// NOTE that this is a workaround for an apparent kernel bug where if
// a signal handler for SIGBREAK is installed then that signal handler
--- 1934,1962 ----
}
WindowsSemaphore::WindowsSemaphore(uint value) {
_semaphore = ::CreateSemaphore(NULL, value, LONG_MAX, NULL);
! guarantee(_semaphore != NULL, "CreateSemaphore failed with error code: %lu", GetLastError());
}
WindowsSemaphore::~WindowsSemaphore() {
::CloseHandle(_semaphore);
}
void WindowsSemaphore::signal(uint count) {
if (count > 0) {
BOOL ret = ::ReleaseSemaphore(_semaphore, count, NULL);
! assert(ret != 0, "ReleaseSemaphore failed with error code: %lu", GetLastError());
}
}
void WindowsSemaphore::wait() {
DWORD ret = ::WaitForSingleObject(_semaphore, INFINITE);
! assert(ret != WAIT_FAILED, "WaitForSingleObject failed with error code: %lu", GetLastError());
! assert(ret == WAIT_OBJECT_0, "WaitForSingleObject failed with return value: %lu", ret);
}
// sun.misc.Signal
// NOTE that this is a workaround for an apparent kernel bug where if
// a signal handler for SIGBREAK is installed then that signal handler
*** 2342,2353 ****
return EXCEPTION_CONTINUE_SEARCH;
}
static inline void report_error(Thread* t, DWORD exception_code,
address addr, void* siginfo, void* context) {
! VMError err(t, exception_code, addr, siginfo, context);
! err.report_and_die();
// If UseOsErrorReporting, this will return here and save the error file
// somewhere where we can find it in the minidump.
}
--- 2342,2352 ----
return EXCEPTION_CONTINUE_SEARCH;
}
static inline void report_error(Thread* t, DWORD exception_code,
address addr, void* siginfo, void* context) {
! VMError::report_and_die(t, exception_code, addr, siginfo, context);
// If UseOsErrorReporting, this will return here and save the error file
// somewhere where we can find it in the minidump.
}
*** 3323,3333 ****
void os::pd_commit_memory_or_exit(char* addr, size_t size, bool exec,
const char* mesg) {
assert(mesg != NULL, "mesg must be specified");
if (!pd_commit_memory(addr, size, exec)) {
warn_fail_commit_memory(addr, size, exec);
! vm_exit_out_of_memory(size, OOM_MMAP_ERROR, mesg);
}
}
void os::pd_commit_memory_or_exit(char* addr, size_t size,
size_t alignment_hint, bool exec,
--- 3322,3332 ----
void os::pd_commit_memory_or_exit(char* addr, size_t size, bool exec,
const char* mesg) {
assert(mesg != NULL, "mesg must be specified");
if (!pd_commit_memory(addr, size, exec)) {
warn_fail_commit_memory(addr, size, exec);
! vm_exit_out_of_memory(size, OOM_MMAP_ERROR, "%s", mesg);
}
}
void os::pd_commit_memory_or_exit(char* addr, size_t size,
size_t alignment_hint, bool exec,
*** 5257,5267 ****
fatal("corrupted C heap");
}
}
DWORD err = GetLastError();
if (err != ERROR_NO_MORE_ITEMS && err != ERROR_CALL_NOT_IMPLEMENTED) {
! fatal(err_msg("heap walk aborted with error %d", err));
}
HeapUnlock(heap);
}
mallocDebugIntervalCounter = 0;
}
--- 5256,5266 ----
fatal("corrupted C heap");
}
}
DWORD err = GetLastError();
if (err != ERROR_NO_MORE_ITEMS && err != ERROR_CALL_NOT_IMPLEMENTED) {
! fatal("heap walk aborted with error %d", err);
}
HeapUnlock(heap);
}
mallocDebugIntervalCounter = 0;
}
*** 5976,5987 ****
} else {
// release memory
os::release_memory_special(actual_location, expected_allocation_size);
// only now check, after releasing any memory to avoid any leaks.
assert(actual_location == expected_location,
! err_msg("Failed to allocate memory at requested location " PTR_FORMAT " of size " SIZE_FORMAT ", is " PTR_FORMAT " instead",
! expected_location, expected_allocation_size, actual_location));
}
}
// restore globals
UseLargePagesIndividualAllocation = old_use_large_pages_individual_allocation;
--- 5975,5986 ----
} else {
// release memory
os::release_memory_special(actual_location, expected_allocation_size);
// only now check, after releasing any memory to avoid any leaks.
assert(actual_location == expected_location,
! "Failed to allocate memory at requested location " PTR_FORMAT " of size " SIZE_FORMAT ", is " PTR_FORMAT " instead",
! expected_location, expected_allocation_size, actual_location);
}
}
// restore globals
UseLargePagesIndividualAllocation = old_use_large_pages_individual_allocation;
< prev index next >