Index: src/Common/Stats/Heap.cpp
===================================================================
--- src/Common/Stats/Heap.cpp	(revision 259012e3d5cbf2639379fff3cc51ef41fb9cb5cf)
+++ src/Common/Stats/Heap.cpp	(revision 3c55fcdbcd55d1744f1b2f592b1b158517e23781)
@@ -21,12 +21,15 @@
 #include <iostream>
 
-#if defined(__has_feature)
+// Most of the other statistics features are deactivated only by defining
+// NO_STATISTICS (or their NO_%_STATISTICS macro). However the heap has some
+// other compatability concerns and will disable itself in some cases.
+//
+// I do not claim to understand these cases. But TCMALLOC is often defined by
+// default and you can pass --disable-gprofiler to configure to remove it.
+
+#if defined(NO_STATISTICS) || defined(TCMALLOC) || defined(__SANITIZE_ADDRESS__)
+	#define NO_HEAP_STATISTICS
+#elif defined(__has_feature)
 	#if __has_feature(address_sanitizer)
-		#define NO_HEAP_STATISTICS
-	# endif
-#endif
-
-#if defined( NO_STATISTICS ) || defined( TCMALLOC ) || defined(__SANITIZE_ADDRESS__)
-	#if !defined(NO_HEAP_STATISTICS)
 		#define NO_HEAP_STATISTICS
 	#endif
