Index: tests/heap.cfa
===================================================================
--- tests/heap.cfa	(revision 92847f793843cc0d5dd7a0e512318148b570bda7)
+++ tests/heap.cfa	(revision 943a0790fa3013aaf65a0d2e653700b57b68354a)
@@ -10,6 +10,6 @@
 // Created On       : Tue Nov  6 17:54:56 2018
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sun Aug  9 08:05:16 2020
-// Update Count     : 57
+// Last Modified On : Mon Sep  7 18:06:06 2020
+// Update Count     : 71
 // 
 
@@ -205,4 +205,78 @@
 			free( area );
 		} // for
+	} // for
+
+	// check malloc/resize/free (sbrk)
+
+	for ( i; 2 ~ NoOfAllocs ~ 12 ) {
+		// initial N byte allocation
+		char * area = (char *)malloc( i );
+		area[0] = '\345'; area[i - 1] = '\345';			// fill first/penultimate byte
+
+		// Do not start this loop index at 0 because resize of 0 bytes frees the storage.
+		int prev = i;
+		for ( s; i ~ 256 * 1024 ~ 26 ) {				// start at initial memory request
+			if ( area[0] != '\345' || area[prev - 1] != '\345' ) abort( "malloc/resize/free corrupt storage" );
+			area = (char *)resize( area, s );			// attempt to reuse storage
+			area[0] = area[s - 1] = '\345';				// fill last byte
+			prev = s;
+		} // for
+		free( area );
+	} // for
+
+	// check malloc/resize/free (mmap)
+
+	for ( i; NoOfAllocs ~ 12 ) {
+		// initial N byte allocation
+		size_t s = i + default_mmap_start();			// cross over point
+		char * area = (char *)malloc( s );
+		area[0] = '\345'; area[s - 1] = '\345';			// fill first/penultimate byte
+
+		// Do not start this loop index at 0 because resize of 0 bytes frees the storage.
+		int prev = s;
+		for ( r; s ~ 256 * 1024 ~ 26 ) {				// start at initial memory request
+			if ( area[0] != '\345' || area[prev - 1] != '\345' ) abort( "malloc/resize/free corrupt storage" );
+			area = (char *)resize( area, s );			// attempt to reuse storage
+			area[0] = area[r - 1] = '\345';				// fill last byte
+			prev = r;
+		} // for
+		free( area );
+	} // for
+
+	// check malloc/realloc/free (sbrk)
+
+	for ( i; 2 ~ NoOfAllocs ~ 12 ) {
+		// initial N byte allocation
+		char * area = (char *)malloc( i );
+		area[0] = '\345'; area[i - 1] = '\345';			// fill first/penultimate byte
+
+		// Do not start this loop index at 0 because realloc of 0 bytes frees the storage.
+		int prev = i;
+		for ( s; i ~ 256 * 1024 ~ 26 ) {				// start at initial memory request
+			if ( area[0] != '\345' || area[prev - 1] != '\345' ) abort( "malloc/realloc/free corrupt storage" );
+			area = (char *)realloc( area, s );			// attempt to reuse storage
+			area[s - 1] = '\345';						// fill last byte
+			prev = s;
+		} // for
+		free( area );
+	} // for
+
+	// check malloc/realloc/free (mmap)
+
+	for ( i; NoOfAllocs ~ 12 ) {
+		// initial N byte allocation
+		size_t s = i + default_mmap_start();			// cross over point
+		char * area = (char *)malloc( s );
+		area[0] = '\345'; area[s - 1] = '\345';			// fill first/penultimate byte
+
+		// Do not start this loop index at 0 because realloc of 0 bytes frees the storage.
+		int prev = s;
+		for ( r; s ~ 256 * 1024 ~ 26 ) {				// start at initial memory request
+			if ( area[0] != '\345' || area[prev - 1] != '\345' ) abort( "malloc/realloc/free corrupt storage" );
+			area = (char *)realloc( area, s );			// attempt to reuse storage
+			area[r - 1] = '\345';						// fill last byte
+			prev = r;
+		} // for
+		free( area );
 	} // for
 
@@ -320,4 +394,28 @@
 	} // for
 
+	// check memalign/resize with align/free
+
+	amount = 2;
+	for ( a; libAlign() ~= limit ~ a ) {				// generate powers of 2
+		// initial N byte allocation
+		char * area = (char *)memalign( a, amount );	// aligned N-byte allocation
+		//sout | alignments[a] | area | endl;
+		if ( (size_t)area % a != 0 || malloc_alignment( area ) != a ) { // check for initial alignment
+			abort( "memalign/resize with align/free bad alignment : memalign(%d,%d) = %p", (int)a, (int)amount, area );
+		} // if
+		area[0] = '\345'; area[amount - 2] = '\345';	// fill first/penultimate byte
+
+		// Do not start this loop index at 0 because resize of 0 bytes frees the storage.
+		for ( s; amount ~ 256 * 1024 ) {				// start at initial memory request
+			area = (char *)resize( area, a * 2, s );	// attempt to reuse storage
+			//sout | i | area | endl;
+			if ( (size_t)area % a * 2 != 0 ) {			// check for initial alignment
+				abort( "memalign/resize with align/free bad alignment %p", area );
+			} // if
+			area[s - 1] = '\345';						// fill last byte
+		} // for
+		free( area );
+	} // for
+
 	// check memalign/realloc with align/free
 
