src/hotspot/share/memory/allocation.hpp
changeset 54927 1512d88b24c6
parent 54764 865ec913f916
child 55745 fa337ff85b9a
child 58678 9cf78a70fa4f
--- a/src/hotspot/share/memory/allocation.hpp	Fri May 17 10:48:02 2019 -0400
+++ b/src/hotspot/share/memory/allocation.hpp	Fri May 17 08:29:55 2019 -0700
@@ -254,10 +254,9 @@
   // into a single contiguous memory block, so we can use these
   // two pointers to quickly determine if something is in the
   // shared metaspace.
-  //
   // When CDS is not enabled, both pointers are set to NULL.
-  static void* _shared_metaspace_base; // (inclusive) low address
-  static void* _shared_metaspace_top;  // (exclusive) high address
+  static void* _shared_metaspace_base;  // (inclusive) low address
+  static void* _shared_metaspace_top;   // (exclusive) high address
 
  public:
 
@@ -269,7 +268,8 @@
   static bool is_shared(const MetaspaceObj* p) {
     // If no shared metaspace regions are mapped, _shared_metaspace_{base,top} will
     // both be NULL and all values of p will be rejected quickly.
-    return (((void*)p) < _shared_metaspace_top && ((void*)p) >= _shared_metaspace_base);
+    return (((void*)p) < _shared_metaspace_top &&
+            ((void*)p) >= _shared_metaspace_base);
   }
   bool is_shared() const { return MetaspaceObj::is_shared(this); }
 
@@ -279,6 +279,12 @@
     _shared_metaspace_base = base;
     _shared_metaspace_top = top;
   }
+
+  static void expand_shared_metaspace_range(void* top) {
+    assert(top >= _shared_metaspace_top, "must be");
+    _shared_metaspace_top = top;
+  }
+
   static void* shared_metaspace_base() { return _shared_metaspace_base; }
   static void* shared_metaspace_top()  { return _shared_metaspace_top;  }