< prev index next >

share/runtime/os.cpp

Print this page
rev 1 : G1GC+POGC+NVDIMM Patch with latest comments incorporated from all.

@@ -74,10 +74,15 @@
 address           os::_polling_page       = NULL;
 volatile int32_t* os::_mem_serialize_page = NULL;
 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];
 
 #ifndef PRODUCT
 julong os::num_mallocs = 0;         // # of calls to malloc/realloc

@@ -1744,19 +1749,42 @@
     MemTracker::record_virtual_memory_commit((address)addr, bytes, CALLER_PC);
   }
   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);
   if (res) {
     MemTracker::record_virtual_memory_commit((address)addr, size, CALLER_PC);
   }
   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);
   MemTracker::record_virtual_memory_commit((address)addr, bytes, CALLER_PC);
 }
< prev index next >