< prev index next >

share/gc/g1/heapRegionManager.hpp

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

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -166,12 +166,18 @@
   void insert_list_into_free_list(FreeRegionList* list) {
     _free_list.add_ordered(list);
   }
 
   HeapRegion* allocate_free_region(bool is_old) {
-    HeapRegion* hr = _free_list.remove_region(is_old);
-
+    HeapRegion* hr = NULL;
+    if (os::has_nvdimm() && !is_old) {
+      hr = _free_list.show_tail();
+      if ((address)(hr->top()) < os::dram_heapbase()) {
+        return NULL;
+      }
+    }
+    hr = _free_list.remove_region(is_old);
     if (hr != NULL) {
       assert(hr->next() == NULL, "Single region should not have next");
       assert(is_available(hr->hrm_index()), "Must be committed");
     }
     return hr;
< prev index next >