diff src/share/vm/services/memPtr.hpp @ 6937:69ad7823b1ca

8001591: NMT: assertion failed: assert(rec->addr() + rec->size() <= cur->base()) failed: Can not overlap in memSnapshot.cpp Summary: NMT should allow overlapping committed regions as long as they belong to the same reserved region Reviewed-by: dholmes, coleenp
author zgu
date Mon, 05 Nov 2012 15:30:22 -0500
parents 716c64bda5ba
children fb3190e77d3c
line wrap: on
line diff
--- a/src/share/vm/services/memPtr.hpp	Thu Oct 25 16:33:40 2012 -0400
+++ b/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