--- old/share/runtime/os.cpp 2018-06-15 09:47:42.642912571 -0700 +++ new/share/runtime/os.cpp 2018-06-15 09:47:42.606912570 -0700 @@ -76,6 +76,11 @@ uintptr_t os::_serialize_page_mask = 0; volatile unsigned int os::_rand_seed = 1; int os::_processor_count = 0; +bool os::_nvdimm_present = false; +int os::_nvdimm_fd = -1; +address os::_dram_heap_base = NULL; +address os::_nvdimm_heap_base = NULL; +uint os::_nvdimm_region_length = 0; int os::_initial_active_processor_count = 0; size_t os::_page_sizes[os::page_sizes_max]; @@ -1746,6 +1751,17 @@ return res; } +bool os::commit_memory(char* addr, size_t size, bool executable, int file_desc, size_t offset) { + + bool res = false; + + if (os::map_memory_to_file(addr, size, file_desc, offset, executable, false) != NULL) { + MemTracker::record_virtual_memory_commit((address)addr, size, CALLER_PC); + return true; + } + return false; +} + bool os::commit_memory(char* addr, size_t size, size_t alignment_hint, bool executable) { bool res = os::pd_commit_memory(addr, size, alignment_hint, executable); @@ -1755,6 +1771,18 @@ return res; } +bool os::commit_memory(char* addr, size_t size, size_t alignment_hint, + bool executable, int file_desc, size_t offset) { + + // ignoring alignemnt hint. + bool res = false; + if (os::map_memory_to_file(addr, size, file_desc, offset, executable, false) != NULL) { + MemTracker::record_virtual_memory_commit((address)addr, size, CALLER_PC); + return true; + } + return false; +} + void os::commit_memory_or_exit(char* addr, size_t bytes, bool executable, const char* mesg) { pd_commit_memory_or_exit(addr, bytes, executable, mesg);