src/share/vm/services/memPtr.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Cdiff src/share/vm/services/memPtr.hpp

src/share/vm/services/memPtr.hpp

Print this page

        

*** 297,318 **** inline bool is_same_region(const MemPointerRecord* other) const { return (addr() == other->addr() && size() == other->size()); } // if this memory region fully contains another one ! inline bool contains_region(const MemPointerRecord* other) const { ! return contains_region(other->addr(), other->size()); } // if this memory region fully contains specified memory range ! inline bool contains_region(address add, size_t sz) const { return (addr() <= add && addr() + size() >= add + sz); } ! inline bool contains_address(address add) const { return (addr() <= add && addr() + size() > add); } }; // MemPointerRecordEx also records callsite pc, from where // the memory block is allocated class MemPointerRecordEx : public MemPointerRecord { --- 297,329 ---- inline bool is_same_region(const MemPointerRecord* other) const { return (addr() == other->addr() && size() == other->size()); } // if this memory region fully contains another one ! inline bool contain_region(const MemPointerRecord* other) const { ! return contain_region(other->addr(), other->size()); } // if this memory region fully contains specified memory range ! inline bool contain_region(address add, size_t sz) const { return (addr() <= add && addr() + size() >= add + sz); } ! inline bool contain_address(address add) const { return (addr() <= add && addr() + size() > add); } + + // if this memory region overlaps another region + inline bool overlap_region(const MemPointerRecord* other) const { + assert(other != NULL, "Just check"); + assert(size() > 0 && other->size() > 0, "empty range"); + return contain_address(other->addr()) || + contain_address(other->addr() + other->size() - 1) || // exclude end address + other->contain_address(addr()) || + other->contain_address(addr() + size() - 1); // exclude end address + } + }; // MemPointerRecordEx also records callsite pc, from where // the memory block is allocated class MemPointerRecordEx : public MemPointerRecord {
src/share/vm/services/memPtr.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File