5089 // call to exit(3C). There can be only 32 of these functions registered
5090 // and atexit() does not set errno.
5091
5092 if (PerfAllowAtExitRegistration) {
5093 // only register atexit functions if PerfAllowAtExitRegistration is set.
5094 // atexit functions can be delayed until process exit time, which
5095 // can be problematic for embedded VM situations. Embedded VMs should
5096 // call DestroyJavaVM() to assure that VM resources are released.
5097
5098 // note: perfMemory_exit_helper atexit function may be removed in
5099 // the future if the appropriate cleanup code can be added to the
5100 // VM_Exit VMOperation's doit method.
5101 if (atexit(perfMemory_exit_helper) != 0) {
5102 warning("os::init_2 atexit(perfMemory_exit_helper) failed");
5103 }
5104 }
5105
5106 // initialize thread priority policy
5107 prio_init();
5108
5109 if (!FLAG_IS_DEFAULT(AllocateHeapAt)) {
5110 set_coredump_filter(false /*largepages*/, true /*dax_shared*/);
5111 }
5112 return JNI_OK;
5113 }
5114
5115 // Mark the polling page as unreadable
5116 void os::make_polling_page_unreadable(void) {
5117 if (!guard_memory((char*)_polling_page, Linux::page_size())) {
5118 fatal("Could not disable polling page");
5119 }
5120 }
5121
5122 // Mark the polling page as readable
5123 void os::make_polling_page_readable(void) {
5124 if (!linux_mprotect((char *)_polling_page, Linux::page_size(), PROT_READ)) {
5125 fatal("Could not enable polling page");
5126 }
5127 }
5128
5129 // older glibc versions don't have this macro (which expands to
|
5089 // call to exit(3C). There can be only 32 of these functions registered
5090 // and atexit() does not set errno.
5091
5092 if (PerfAllowAtExitRegistration) {
5093 // only register atexit functions if PerfAllowAtExitRegistration is set.
5094 // atexit functions can be delayed until process exit time, which
5095 // can be problematic for embedded VM situations. Embedded VMs should
5096 // call DestroyJavaVM() to assure that VM resources are released.
5097
5098 // note: perfMemory_exit_helper atexit function may be removed in
5099 // the future if the appropriate cleanup code can be added to the
5100 // VM_Exit VMOperation's doit method.
5101 if (atexit(perfMemory_exit_helper) != 0) {
5102 warning("os::init_2 atexit(perfMemory_exit_helper) failed");
5103 }
5104 }
5105
5106 // initialize thread priority policy
5107 prio_init();
5108
5109 if (!FLAG_IS_DEFAULT(AllocateHeapAt) || !FLAG_IS_DEFAULT(AllocateOldGenAt)) {
5110 set_coredump_filter(false /*largepages*/, true /*dax_shared*/);
5111 }
5112 return JNI_OK;
5113 }
5114
5115 // Mark the polling page as unreadable
5116 void os::make_polling_page_unreadable(void) {
5117 if (!guard_memory((char*)_polling_page, Linux::page_size())) {
5118 fatal("Could not disable polling page");
5119 }
5120 }
5121
5122 // Mark the polling page as readable
5123 void os::make_polling_page_readable(void) {
5124 if (!linux_mprotect((char *)_polling_page, Linux::page_size(), PROT_READ)) {
5125 fatal("Could not enable polling page");
5126 }
5127 }
5128
5129 // older glibc versions don't have this macro (which expands to
|