hotspot/src/share/vm/services/memPtr.hpp
changeset 14388 2b7db60361a2
parent 14120 7d298141c258
child 14484 901d216b74bf
--- a/hotspot/src/share/vm/services/memPtr.hpp	Thu Oct 25 16:33:40 2012 -0400
+++ b/hotspot/src/share/vm/services/memPtr.hpp	Mon Nov 05 15:30:22 2012 -0500
@@ -311,6 +311,17 @@
   inline bool contains_address(address add) const {
     return (addr() <= add && addr() + size() > add);
   }
+
+  // if this memory region overlaps another region
+  inline bool overlaps_region(const MemPointerRecord* other) const {
+    assert(other != NULL, "Just check");
+    assert(size() > 0 && other->size() > 0, "empty range");
+    return contains_address(other->addr()) ||
+           contains_address(other->addr() + other->size() - 1) || // exclude end address
+           other->contains_address(addr()) ||
+           other->contains_address(addr() + size() - 1); // exclude end address
+  }
+
 };
 
 // MemPointerRecordEx also records callsite pc, from where