< prev index next >

src/hotspot/share/memory/metaspace/blockTree.cpp

Print this page
*** 180,12 ***
    _counter.check(counter);
  
    #undef assrt0n
  }
  
! void BlockTree::zap_range(MetaWord* p, size_t word_size) {
!   memset(p, 0xF3, word_size * sizeof(MetaWord));
  }
  
  void BlockTree::print_tree(outputStream* st) const {
  
    // Note: we do not print the tree indented, since I found that printing it
--- 180,12 ---
    _counter.check(counter);
  
    #undef assrt0n
  }
  
! void BlockTree::zap_block(MetaBlock bl) {
!   memset(bl.base(), 0xF3, bl.word_size() * sizeof(MetaWord));
  }
  
  void BlockTree::print_tree(outputStream* st) const {
  
    // Note: we do not print the tree indented, since I found that printing it

*** 224,10 ***
--- 224,16 ---
            st->print_cr("@" PTR_FORMAT ": unreadable (skipping rest of chain).", p2i(n2));
            break; // stop printing this chain.
          }
        }
  
+       // Handle simple circularities
+       if (n == n->_right || n == n->_left || n == n->_next) {
+         st->print_cr("@" PTR_FORMAT ": circularity detected.", p2i(n));
+         return; // stop printing
+       }
+ 
        // Handle children.
        if (n->_right != nullptr) {
          walkinfo info2;
          info2.n = n->_right;
          info2.depth = info.depth + 1;
< prev index next >