< prev index next >

src/hotspot/share/gc/g1/g1CollectedHeap.hpp

Print this page
rev 54468 : [mq]: 8221509.webrev.0

@@ -354,10 +354,19 @@
     assert_at_safepoint();                                                    \
     assert(Thread::current_or_null() != NULL, "no current thread");           \
     assert(Thread::current()->is_VM_thread(), "current thread is not VM thread"); \
   } while (0)
 
+#define assert_used_and_recalculate_used(g1h)                                 \
+  do {                                                                        \
+    size_t cur_used_bytes = g1h->used();                                      \
+    size_t recal_used_bytes = g1h->recalculate_used();                        \
+    assert(cur_used_bytes == recal_used_bytes, "Used(" SIZE_FORMAT ") is not" \
+           " same as recalculated used(" SIZE_FORMAT ").",                    \
+           cur_used_bytes, recal_used_bytes);                                 \
+  } while (0)
+
   const char* young_gc_name() const;
 
   // The young region list.
   G1EdenRegions _eden;
   G1SurvivorRegions _survivor;
< prev index next >