< prev index next >

src/hotspot/share/cds/dumpAllocStats.cpp

Print this page
*** 109,5 ***
--- 109,18 ---
    msg.info("Field  CP entries = %6d, archived = %6d (%5.1f%%), reverted = %6d",
             _num_field_cp_entries, _num_field_cp_entries_archived,
             percent_of(_num_field_cp_entries_archived, _num_field_cp_entries),
             _num_field_cp_entries_reverted);
  }
+ 
+ #ifdef ASSERT
+ void DumpAllocStats::verify(int expected_byte_size, bool read_only) const {
+   int bytes = 0;
+   const int what = (int)(read_only ? RO : RW);
+   for (int type = 0; type < int(_number_of_types); type ++) {
+     bytes += _bytes[what][type];
+   }
+   assert(bytes == expected_byte_size, "counter mismatch (%s: %d vs %d)",
+          (read_only ? "RO" : "RW"), bytes, expected_byte_size);
+ }
+ #endif // ASSERT
+ 
< prev index next >