Index: libcfa/src/heap.cfa
===================================================================
--- libcfa/src/heap.cfa	(revision 5cfb8b12c10a9e8aaf77d4435350d6b39af04561)
+++ libcfa/src/heap.cfa	(revision c58ead7c304c33bc8c33d1ca270fffcfa955ec02)
@@ -10,6 +10,6 @@
 // Created On       : Tue Dec 19 21:58:35 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Aug  2 18:48:30 2023
-// Update Count     : 1614
+// Last Modified On : Mon Sep 11 11:21:10 2023
+// Update Count     : 1615
 //
 
@@ -691,4 +691,16 @@
 	return stats;
 } // collectStats
+
+static inline void clearStats() {
+	lock( mgrLock );
+
+	// Zero the heap master and all active thread heaps.
+	HeapStatisticsCtor( heapMaster.stats );
+	for ( Heap * heap = heapMaster.heapManagersList; heap; heap = heap->nextHeapManager ) {
+		HeapStatisticsCtor( heap->stats );
+	} // for
+
+	unlock( mgrLock );
+} // clearStats
 #endif // __STATISTICS__
 
@@ -1556,4 +1568,17 @@
 
 
+	// Zero the heap master and all active thread heaps.
+	void malloc_stats_clear() {
+		#ifdef __STATISTICS__
+		clearStats();
+		#else
+		#define MALLOC_STATS_MSG "malloc_stats statistics disabled.\n"
+		if ( write( STDERR_FILENO, MALLOC_STATS_MSG, sizeof( MALLOC_STATS_MSG ) - 1 /* size includes '\0' */ ) == -1 ) {
+			abort( "**** Error **** write failed in malloc_stats" );
+		} // if
+		#endif // __STATISTICS__
+	} // malloc_stats_clear
+
+
 	// Changes the file descriptor where malloc_stats() writes statistics.
 	int malloc_stats_fd( int fd __attribute__(( unused )) ) libcfa_public {
Index: libcfa/src/heap.hfa
===================================================================
--- libcfa/src/heap.hfa	(revision 5cfb8b12c10a9e8aaf77d4435350d6b39af04561)
+++ libcfa/src/heap.hfa	(revision c58ead7c304c33bc8c33d1ca270fffcfa955ec02)
@@ -10,6 +10,6 @@
 // Created On       : Tue May 26 11:23:55 2020
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Oct  4 19:08:55 2022
-// Update Count     : 23
+// Last Modified On : Mon Sep 11 11:18:18 2023
+// Update Count     : 24
 // 
 
@@ -43,4 +43,5 @@
 	size_t malloc_mmap_start();							// crossover allocation size from sbrk to mmap
 	size_t malloc_unfreed();							// heap unfreed size (bytes)
+	void malloc_stats_clear();							// clear heap statistics
 } // extern "C"
 
