Index: libcfa/src/heap.cfa
===================================================================
--- libcfa/src/heap.cfa	(revision 15b05c8f1fef160417b58dbe09203cc64a1d8cc0)
+++ libcfa/src/heap.cfa	(revision 10b3fc33467a6ebb24da6c05af33e10364fb570f)
@@ -10,6 +10,6 @@
 // Created On       : Tue Dec 19 21:58:35 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Aug  9 19:03:02 2021
-// Update Count     : 1040
+// Last Modified On : Sun Jan  2 23:29:41 2022
+// Update Count     : 1058
 //
 
@@ -263,26 +263,26 @@
 #ifdef __STATISTICS__
 // Heap statistics counters.
-static unsigned int malloc_zero_calls, malloc_calls;
-static unsigned long long int malloc_storage;
-static unsigned int aalloc_zero_calls, aalloc_calls;
-static unsigned long long int aalloc_storage;
-static unsigned int calloc_zero_calls, calloc_calls;
-static unsigned long long int calloc_storage;
-static unsigned int memalign_zero_calls, memalign_calls;
-static unsigned long long int memalign_storage;
-static unsigned int amemalign_zero_calls, amemalign_calls;
-static unsigned long long int amemalign_storage;
-static unsigned int cmemalign_zero_calls, cmemalign_calls;
-static unsigned long long int cmemalign_storage;
-static unsigned int resize_zero_calls, resize_calls;
-static unsigned long long int resize_storage;
-static unsigned int realloc_zero_calls, realloc_calls;
-static unsigned long long int realloc_storage;
-static unsigned int free_zero_calls, free_calls;
-static unsigned long long int free_storage;
+static unsigned int malloc_calls, malloc_0_calls;
+static unsigned long long int malloc_storage_request, malloc_storage_alloc;
+static unsigned int aalloc_calls, aalloc_0_calls;
+static unsigned long long int aalloc_storage_request, aalloc_storage_alloc;
+static unsigned int calloc_calls, calloc_0_calls;
+static unsigned long long int calloc_storage_request, calloc_storage_alloc;
+static unsigned int memalign_calls, memalign_0_calls;
+static unsigned long long int memalign_storage_request, memalign_storage_alloc;
+static unsigned int amemalign_calls, amemalign_0_calls;
+static unsigned long long int amemalign_storage_request, amemalign_storage_alloc;
+static unsigned int cmemalign_calls, cmemalign_0_calls;
+static unsigned long long int cmemalign_storage_request, cmemalign_storage_alloc;
+static unsigned int resize_calls, resize_0_calls;
+static unsigned long long int resize_storage_request, resize_storage_alloc;
+static unsigned int realloc_calls, realloc_0_calls;
+static unsigned long long int realloc_storage_request, realloc_storage_alloc;
+static unsigned int free_calls, free_null_calls;
+static unsigned long long int free_storage_request, free_storage_alloc;
 static unsigned int mmap_calls;
-static unsigned long long int mmap_storage;
+static unsigned long long int mmap_storage_request, mmap_storage_alloc;
 static unsigned int munmap_calls;
-static unsigned long long int munmap_storage;
+static unsigned long long int munmap_storage_request, munmap_storage_alloc;
 static unsigned int sbrk_calls;
 static unsigned long long int sbrk_storage;
@@ -294,29 +294,29 @@
 	char helpText[1024];
 	__cfaabi_bits_print_buffer( STDERR_FILENO, helpText, sizeof(helpText),
-								"\nHeap statistics:\n"
-								"  malloc    0-calls %'u; >0-calls %'u; storage %'llu bytes\n"
-								"  aalloc    0-calls %'u; >0-calls %'u; storage %'llu bytes\n"
-								"  calloc    0-calls %'u; >0-calls %'u; storage %'llu bytes\n"
-								"  memalign  0-calls %'u; >0-calls %'u; storage %'llu bytes\n"
-								"  amemalign 0-calls %'u; >0-calls %'u; storage %'llu bytes\n"
-								"  cmemalign 0-calls %'u; >0-calls %'u; storage %'llu bytes\n"
-								"  resize    0-calls %'u; >0-calls %'u; storage %'llu bytes\n"
-								"  realloc   0-calls %'u; >0-calls %'u; storage %'llu bytes\n"
-								"  free      0-calls %'u; >0-calls %'u; storage %'llu bytes\n"
-								"  mmap      calls %'u; storage %'llu bytes\n"
-								"  munmap    calls %'u; storage %'llu bytes\n"
-								"  sbrk      calls %'u; storage %'llu bytes\n",
-								malloc_zero_calls, malloc_calls, malloc_storage,
-								aalloc_zero_calls, aalloc_calls, aalloc_storage,
-								calloc_zero_calls, calloc_calls, calloc_storage,
-								memalign_zero_calls, memalign_calls, memalign_storage,
-								amemalign_zero_calls, amemalign_calls, amemalign_storage,
-								cmemalign_zero_calls, cmemalign_calls, cmemalign_storage,
-								resize_zero_calls, resize_calls, resize_storage,
-								realloc_zero_calls, realloc_calls, realloc_storage,
-								free_zero_calls, free_calls, free_storage,
-								mmap_calls, mmap_storage,
-								munmap_calls, munmap_storage,
-								sbrk_calls, sbrk_storage
+								"\nHeap statistics: (storage request / allocation + header)\n"
+								"  malloc    >0 calls %'u; 0 calls %'u; storage %'llu / %'llu bytes\n"
+								"  aalloc    >0 calls %'u; 0 calls %'u; storage %'llu / %'llu bytes\n"
+								"  calloc    >0 calls %'u; 0 calls %'u; storage %'llu / %'llu bytes\n"
+								"  memalign  >0 calls %'u; 0 calls %'u; storage %'llu / %'llu bytes\n"
+								"  amemalign >0 calls %'u; 0 calls %'u; storage %'llu / %'llu bytes\n"
+								"  cmemalign >0 calls %'u; 0 calls %'u; storage %'llu / %'llu bytes\n"
+								"  resize    >0 calls %'u; 0 calls %'u; storage %'llu / %'llu bytes\n"
+								"  realloc   >0 calls %'u; 0 calls %'u; storage %'llu / %'llu bytes\n"
+								"  free      !null calls %'u; null calls %'u; storage %'llu / %'llu bytes\n"
+								"  sbrk      calls %'u; storage %'llu bytes\n"
+								"  mmap      calls %'u; storage %'llu / %'llu bytes\n"
+								"  munmap    calls %'u; storage %'llu / %'llu bytes\n",
+								malloc_calls, malloc_0_calls, malloc_storage_request, malloc_storage_alloc,
+								aalloc_calls, aalloc_0_calls, aalloc_storage_request, aalloc_storage_alloc,
+								calloc_calls, calloc_0_calls, calloc_storage_request, calloc_storage_alloc,
+								memalign_calls, memalign_0_calls, memalign_storage_request, memalign_storage_alloc,
+								amemalign_calls, amemalign_0_calls, amemalign_storage_request, amemalign_storage_alloc,
+								cmemalign_calls, cmemalign_0_calls, cmemalign_storage_request, cmemalign_storage_alloc,
+								resize_calls, resize_0_calls, resize_storage_request, resize_storage_alloc,
+								realloc_calls, realloc_0_calls, realloc_storage_request, realloc_storage_alloc,
+								free_calls, free_null_calls, free_storage_request, free_storage_alloc,
+								sbrk_calls, sbrk_storage,
+								mmap_calls, mmap_storage_request, mmap_storage_alloc,
+								munmap_calls, munmap_storage_request, munmap_storage_alloc
 		);
 } // printStats
@@ -329,29 +329,29 @@
 						"<sizes>\n"
 						"</sizes>\n"
-						"<total type=\"malloc\" 0 count=\"%'u;\" >0 count=\"%'u;\" size=\"%'llu\"/> bytes\n"
-						"<total type=\"aalloc\" 0 count=\"%'u;\" >0 count=\"%'u;\" size=\"%'llu\"/> bytes\n"
-						"<total type=\"calloc\" 0 count=\"%'u;\" >0 count=\"%'u;\" size=\"%'llu\"/> bytes\n"
-						"<total type=\"memalign\" 0 count=\"%'u;\" >0 count=\"%'u;\" size=\"%'llu\"/> bytes\n"
-						"<total type=\"amemalign\" 0 count=\"%'u;\" >0 count=\"%'u;\" size=\"%'llu\"/> bytes\n"
-						"<total type=\"cmemalign\" 0 count=\"%'u;\" >0 count=\"%'u;\" size=\"%'llu\"/> bytes\n"
-						"<total type=\"resize\" 0 count=\"%'u;\" >0 count=\"%'u;\" size=\"%'llu\"/> bytes\n"
-						"<total type=\"realloc\" 0 count=\"%'u;\" >0 count=\"%'u;\" size=\"%'llu\"/> bytes\n"
-						"<total type=\"free\" 0 count=\"%'u;\" >0 count=\"%'u;\" size=\"%'llu\"/> bytes\n"
-						"<total type=\"mmap\" count=\"%'u;\" size=\"%'llu\"/> bytes\n"
-						"<total type=\"munmap\" count=\"%'u;\" size=\"%'llu\"/> bytes\n"
+						"<total type=\"malloc\" >0 count=\"%'u;\" 0 count=\"%'u;\" size=\"%'llu / %'llu\"/> bytes\n"
+						"<total type=\"aalloc\" >0 count=\"%'u;\" 0 count=\"%'u;\" size=\"%'llu / %'llu\"/> bytes\n"
+						"<total type=\"calloc\" >0 count=\"%'u;\" 0 count=\"%'u;\" size=\"%'llu / %'llu\"/> bytes\n"
+						"<total type=\"memalign\" >0 count=\"%'u;\" 0 count=\"%'u;\" size=\"%'llu / %'llu\"/> bytes\n"
+						"<total type=\"amemalign\" >0 count=\"%'u;\" 0 count=\"%'u;\" size=\"%'llu / %'llu\"/> bytes\n"
+						"<total type=\"cmemalign\" >0 count=\"%'u;\" 0 count=\"%'u;\" size=\"%'llu / %'llu\"/> bytes\n"
+						"<total type=\"resize\" >0 count=\"%'u;\" 0 count=\"%'u;\" size=\"%'llu / %'llu\"/> bytes\n"
+						"<total type=\"realloc\" >0 count=\"%'u;\" 0 count=\"%'u;\" size=\"%'llu / %'llu\"/> bytes\n"
+						"<total type=\"free\" !null=\"%'u;\" 0 null=\"%'u;\" size=\"%'llu / %'llu\"/> bytes\n"
 						"<total type=\"sbrk\" count=\"%'u;\" size=\"%'llu\"/> bytes\n"
+						"<total type=\"mmap\" count=\"%'u;\" size=\"%'llu / %'llu\" / > bytes\n"
+						"<total type=\"munmap\" count=\"%'u;\" size=\"%'llu / %'llu\"/> bytes\n"
 						"</malloc>",
-						malloc_zero_calls, malloc_calls, malloc_storage,
-						aalloc_zero_calls, aalloc_calls, aalloc_storage,
-						calloc_zero_calls, calloc_calls, calloc_storage,
-						memalign_zero_calls, memalign_calls, memalign_storage,
-						amemalign_zero_calls, amemalign_calls, amemalign_storage,
-						cmemalign_zero_calls, cmemalign_calls, cmemalign_storage,
-						resize_zero_calls, resize_calls, resize_storage,
-						realloc_zero_calls, realloc_calls, realloc_storage,
-						free_zero_calls, free_calls, free_storage,
-						mmap_calls, mmap_storage,
-						munmap_calls, munmap_storage,
-						sbrk_calls, sbrk_storage
+						malloc_calls, malloc_0_calls, malloc_storage_request, malloc_storage_alloc,
+						aalloc_calls, aalloc_0_calls, aalloc_storage_request, aalloc_storage_alloc,
+						calloc_calls, calloc_0_calls, calloc_storage_request, calloc_storage_alloc,
+						memalign_calls, memalign_0_calls, memalign_storage_request, memalign_storage_alloc,
+						amemalign_calls, amemalign_0_calls, amemalign_storage_request, amemalign_storage_alloc,
+						cmemalign_calls, cmemalign_0_calls, cmemalign_storage_request, cmemalign_storage_alloc,
+						resize_calls, resize_0_calls, resize_storage_request, resize_storage_alloc,
+						realloc_calls, realloc_0_calls, realloc_storage_request, realloc_storage_alloc,
+						free_calls, free_null_calls, free_storage_request, free_storage_alloc,
+						sbrk_calls, sbrk_storage,
+						mmap_calls, mmap_storage_request, mmap_storage_alloc,
+						munmap_calls, munmap_storage_request, munmap_storage_alloc
 		);
 	__cfaabi_bits_write( fileno( stream ), helpText, len );	// ensures all bytes written or exit
@@ -577,5 +577,6 @@
 		#ifdef __STATISTICS__
 		__atomic_add_fetch( &mmap_calls, 1, __ATOMIC_SEQ_CST );
-		__atomic_add_fetch( &mmap_storage, tsize, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &mmap_storage_request, size, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &mmap_storage_alloc, tsize, __ATOMIC_SEQ_CST );
 		#endif // __STATISTICS__
 
@@ -626,5 +627,6 @@
 		#ifdef __STATISTICS__
 		__atomic_add_fetch( &munmap_calls, 1, __ATOMIC_SEQ_CST );
-		__atomic_add_fetch( &munmap_storage, size, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &munmap_storage_request, header->kind.real.size, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &munmap_storage_alloc, size, __ATOMIC_SEQ_CST );
 		#endif // __STATISTICS__
 		if ( munmap( header, size ) == -1 ) {
@@ -642,5 +644,6 @@
 		#ifdef __STATISTICS__
 		__atomic_add_fetch( &free_calls, 1, __ATOMIC_SEQ_CST );
-		__atomic_add_fetch( &free_storage, size, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &free_storage_request, header->kind.real.size, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &free_storage_alloc, size, __ATOMIC_SEQ_CST );
 		#endif // __STATISTICS__
 
@@ -819,7 +822,7 @@
 		if ( likely( size > 0 ) ) {
 			__atomic_add_fetch( &malloc_calls, 1, __ATOMIC_SEQ_CST );
-			__atomic_add_fetch( &malloc_storage, size, __ATOMIC_SEQ_CST );
+			__atomic_add_fetch( &malloc_storage_request, size, __ATOMIC_SEQ_CST );
 		} else {
-			__atomic_add_fetch( &malloc_zero_calls, 1, __ATOMIC_SEQ_CST );
+			__atomic_add_fetch( &malloc_0_calls, 1, __ATOMIC_SEQ_CST );
 		} // if
 		#endif // __STATISTICS__
@@ -835,7 +838,7 @@
 		if ( likely( size > 0 ) ) {
 			__atomic_add_fetch( &aalloc_calls, 1, __ATOMIC_SEQ_CST );
-			__atomic_add_fetch( &aalloc_storage, size, __ATOMIC_SEQ_CST );
+			__atomic_add_fetch( &aalloc_storage_request, size, __ATOMIC_SEQ_CST );
 		} else {
-			__atomic_add_fetch( &aalloc_zero_calls, 1, __ATOMIC_SEQ_CST );
+			__atomic_add_fetch( &aalloc_0_calls, 1, __ATOMIC_SEQ_CST );
 		} // if
 		#endif // __STATISTICS__
@@ -850,5 +853,5 @@
 	  if ( unlikely( size ) == 0 ) {			// 0 BYTE ALLOCATION RETURNS NULL POINTER
 			#ifdef __STATISTICS__
-			__atomic_add_fetch( &calloc_zero_calls, 1, __ATOMIC_SEQ_CST );
+			__atomic_add_fetch( &calloc_0_calls, 1, __ATOMIC_SEQ_CST );
 			#endif // __STATISTICS__
 			return 0p;
@@ -856,5 +859,5 @@
 		#ifdef __STATISTICS__
 		__atomic_add_fetch( &calloc_calls, 1, __ATOMIC_SEQ_CST );
-		__atomic_add_fetch( &calloc_storage, dim * elemSize, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &calloc_storage_request, dim * elemSize, __ATOMIC_SEQ_CST );
 		#endif // __STATISTICS__
 
@@ -891,5 +894,5 @@
 	  if ( unlikely( size == 0 ) ) {					// special cases
 			#ifdef __STATISTICS__
-			__atomic_add_fetch( &resize_zero_calls, 1, __ATOMIC_SEQ_CST );
+			__atomic_add_fetch( &resize_0_calls, 1, __ATOMIC_SEQ_CST );
 			#endif // __STATISTICS__
 			free( oaddr );
@@ -902,5 +905,5 @@
 	  if ( unlikely( oaddr == 0p ) ) {
 			#ifdef __STATISTICS__
-			__atomic_add_fetch( &resize_storage, size, __ATOMIC_SEQ_CST );
+			__atomic_add_fetch( &resize_storage_request, size, __ATOMIC_SEQ_CST );
 			#endif // __STATISTICS__
 			return mallocNoStats( size );
@@ -921,5 +924,5 @@
 
 		#ifdef __STATISTICS__
-		__atomic_add_fetch( &resize_storage, size, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &resize_storage_request, size, __ATOMIC_SEQ_CST );
 		#endif // __STATISTICS__
 
@@ -936,5 +939,5 @@
 	  if ( unlikely( size == 0 ) ) {					// special cases
 			#ifdef __STATISTICS__
-			__atomic_add_fetch( &realloc_zero_calls, 1, __ATOMIC_SEQ_CST );
+			__atomic_add_fetch( &realloc_0_calls, 1, __ATOMIC_SEQ_CST );
 			#endif // __STATISTICS__
 			free( oaddr );
@@ -947,5 +950,5 @@
 	  if ( unlikely( oaddr == 0p ) ) {
 			#ifdef __STATISTICS__
-			__atomic_add_fetch( &realloc_storage, size, __ATOMIC_SEQ_CST );
+			__atomic_add_fetch( &realloc_storage_request, size, __ATOMIC_SEQ_CST );
 			#endif // __STATISTICS__
 			return mallocNoStats( size );
@@ -969,5 +972,5 @@
 
 		#ifdef __STATISTICS__
-	  	__atomic_add_fetch( &realloc_storage, size, __ATOMIC_SEQ_CST );
+	  	__atomic_add_fetch( &realloc_storage_request, size, __ATOMIC_SEQ_CST );
 		#endif // __STATISTICS__
 
@@ -1000,7 +1003,7 @@
 		if ( likely( size > 0 ) ) {
 			__atomic_add_fetch( &memalign_calls, 1, __ATOMIC_SEQ_CST );
-			__atomic_add_fetch( &memalign_storage, size, __ATOMIC_SEQ_CST );
+			__atomic_add_fetch( &memalign_storage_request, size, __ATOMIC_SEQ_CST );
 		} else {
-			__atomic_add_fetch( &memalign_zero_calls, 1, __ATOMIC_SEQ_CST );
+			__atomic_add_fetch( &memalign_0_calls, 1, __ATOMIC_SEQ_CST );
 		} // if
 		#endif // __STATISTICS__
@@ -1016,7 +1019,7 @@
 		if ( likely( size > 0 ) ) {
 			__atomic_add_fetch( &cmemalign_calls, 1, __ATOMIC_SEQ_CST );
-			__atomic_add_fetch( &cmemalign_storage, size, __ATOMIC_SEQ_CST );
+			__atomic_add_fetch( &cmemalign_storage_request, size, __ATOMIC_SEQ_CST );
 		} else {
-			__atomic_add_fetch( &cmemalign_zero_calls, 1, __ATOMIC_SEQ_CST );
+			__atomic_add_fetch( &cmemalign_0_calls, 1, __ATOMIC_SEQ_CST );
 		} // if
 		#endif // __STATISTICS__
@@ -1031,5 +1034,5 @@
 	  if ( unlikely( size ) == 0 ) {					// 0 BYTE ALLOCATION RETURNS NULL POINTER
 			#ifdef __STATISTICS__
-			__atomic_add_fetch( &cmemalign_zero_calls, 1, __ATOMIC_SEQ_CST );
+			__atomic_add_fetch( &cmemalign_0_calls, 1, __ATOMIC_SEQ_CST );
 			#endif // __STATISTICS__
 			return 0p;
@@ -1037,5 +1040,5 @@
 		#ifdef __STATISTICS__
 		__atomic_add_fetch( &cmemalign_calls, 1, __ATOMIC_SEQ_CST );
-		__atomic_add_fetch( &cmemalign_storage, dim * elemSize, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &cmemalign_storage_request, dim * elemSize, __ATOMIC_SEQ_CST );
 		#endif // __STATISTICS__
 
@@ -1101,5 +1104,5 @@
 	  if ( unlikely( addr == 0p ) ) {					// special case
 			#ifdef __STATISTICS__
-			__atomic_add_fetch( &free_zero_calls, 1, __ATOMIC_SEQ_CST );
+			__atomic_add_fetch( &free_null_calls, 1, __ATOMIC_SEQ_CST );
 			#endif // __STATISTICS__
 
@@ -1280,5 +1283,5 @@
   if ( unlikely( size == 0 ) ) {						// special cases
 		#ifdef __STATISTICS__
-		__atomic_add_fetch( &resize_zero_calls, 1, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &resize_0_calls, 1, __ATOMIC_SEQ_CST );
 		#endif // __STATISTICS__
 		free( oaddr );
@@ -1294,5 +1297,5 @@
 		#ifdef __STATISTICS__
 		__atomic_add_fetch( &resize_calls, 1, __ATOMIC_SEQ_CST );
-		__atomic_add_fetch( &resize_storage, size, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &resize_storage_request, size, __ATOMIC_SEQ_CST );
 		#endif // __STATISTICS__
 		return memalignNoStats( nalign, size );
@@ -1329,5 +1332,5 @@
 
 	#ifdef __STATISTICS__
-	__atomic_add_fetch( &resize_storage, size, __ATOMIC_SEQ_CST );
+	__atomic_add_fetch( &resize_storage_request, size, __ATOMIC_SEQ_CST );
 	#endif // __STATISTICS__
 
@@ -1342,5 +1345,5 @@
   if ( unlikely( size == 0 ) ) {						// special cases
 		#ifdef __STATISTICS__
-		__atomic_add_fetch( &realloc_zero_calls, 1, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &realloc_0_calls, 1, __ATOMIC_SEQ_CST );
 		#endif // __STATISTICS__
 		free( oaddr );
@@ -1356,5 +1359,5 @@
 		#ifdef __STATISTICS__
 		__atomic_add_fetch( &realloc_calls, 1, __ATOMIC_SEQ_CST );
-		__atomic_add_fetch( &realloc_storage, size, __ATOMIC_SEQ_CST );
+		__atomic_add_fetch( &realloc_storage_request, size, __ATOMIC_SEQ_CST );
 		#endif // __STATISTICS__
 		return memalignNoStats( nalign, size );
@@ -1380,5 +1383,5 @@
 	#ifdef __STATISTICS__
 	__atomic_add_fetch( &realloc_calls, 1, __ATOMIC_SEQ_CST );
-	__atomic_add_fetch( &realloc_storage, size, __ATOMIC_SEQ_CST );
+	__atomic_add_fetch( &realloc_storage_request, size, __ATOMIC_SEQ_CST );
 	#endif // __STATISTICS__
 
