8227671: G1: assert_used_and_recalculate_used_equal performs work in product builds
authortschatzl
Wed, 17 Jul 2019 16:33:19 +0200
changeset 55721 6891a4438ae6
parent 55720 dec1d532c000
child 55722 5ee183a90e65
8227671: G1: assert_used_and_recalculate_used_equal performs work in product builds Reviewed-by: kbarrett, sangheki
src/hotspot/share/gc/g1/g1CollectedHeap.hpp
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp	Wed Jul 17 16:33:19 2019 +0200
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp	Wed Jul 17 16:33:19 2019 +0200
@@ -353,6 +353,7 @@
     assert(Thread::current()->is_VM_thread(), "current thread is not VM thread"); \
   } while (0)
 
+#ifdef ASSERT
 #define assert_used_and_recalculate_used_equal(g1h)                           \
   do {                                                                        \
     size_t cur_used_bytes = g1h->used();                                      \
@@ -361,6 +362,9 @@
            " same as recalculated used(" SIZE_FORMAT ").",                    \
            cur_used_bytes, recal_used_bytes);                                 \
   } while (0)
+#else
+#define assert_used_and_recalculate_used_equal(g1h) do {} while(0)
+#endif
 
   const char* young_gc_name() const;