Index: tests/alloc.cfa
===================================================================
--- tests/alloc.cfa	(revision 8725c74cdeaaa219c536400e8eb72e820fed787b)
+++ tests/alloc.cfa	(revision 7030dab75c493bbd89de53cb88e496019c794ff4)
@@ -10,6 +10,6 @@
 // Created On       : Wed Feb  3 07:56:22 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sun Feb 16 09:21:13 2020
-// Update Count     : 405
+// Last Modified On : Wed Apr  1 10:58:35 2020
+// Update Count     : 424
 //
 
@@ -28,30 +28,30 @@
 	size_t dim = 10;
 	char fill = '\xde';
-	int * p, * p1;
+	int * ip, * ip1;
 
 	// allocation, non-array types
 
-	p = (int *)malloc( sizeof(*p) );					// C malloc, type unsafe
-	*p = 0xdeadbeef;
-	printf( "C   malloc %#x\n", *p );
-	free( p );
-
-	p = malloc();                                       // CFA malloc, type safe
-	*p = 0xdeadbeef;
-	printf( "CFA malloc %#x\n", *p );
-	free( p );
-
-	p = alloc();                                        // CFA alloc, type safe
-	*p = 0xdeadbeef;
-	printf( "CFA alloc %#x\n", *p );
-	free( p );
-
-	p = alloc_set( fill );								// CFA alloc, fill
-	printf( "CFA alloc, fill %08x\n", *p );
-	free( p );
-
-	p = alloc_set( 3 );									// CFA alloc, fill
-	printf( "CFA alloc, fill %d\n", *p );
-	free( p );
+	ip = (int *)malloc( sizeof(*ip) );					// C malloc, type unsafe
+	*ip = 0xdeadbeef;
+	printf( "C   malloc %#x\n", *ip );
+	free( ip );
+
+	ip = malloc();										// CFA malloc, type safe
+	*ip = 0xdeadbeef;
+	printf( "CFA malloc %#x\n", *ip );
+	free( ip );
+
+	ip = alloc();										// CFA alloc, type safe
+	*ip = 0xdeadbeef;
+	printf( "CFA alloc %#x\n", *ip );
+	free( ip );
+
+	ip = alloc_set( fill );								// CFA alloc, fill
+	printf( "CFA alloc, fill %08x\n", *ip );
+	free( ip );
+
+	ip = alloc_set( 3 );								// CFA alloc, fill
+	printf( "CFA alloc, fill %d\n", *ip );
+	free( ip );
 
 
@@ -59,99 +59,151 @@
 	printf( "\n" );
 
-	p = (int *)calloc( dim, sizeof( *p ) );				// C array calloc, type unsafe
+	ip = (int *)calloc( dim, sizeof( *ip ) );			// C array calloc, type unsafe
 	printf( "C   array calloc, fill 0\n" );
-	for ( i; dim ) { printf( "%#x ", p[i] ); }
-	printf( "\n" );
-	free( p );
-
-	p = calloc( dim );                                  // CFA array calloc, type safe
+	for ( i; dim ) { printf( "%#x ", ip[i] ); }
+	printf( "\n" );
+	free( ip );
+
+	ip = calloc( dim );									// CFA array calloc, type safe
 	printf( "CFA array calloc, fill 0\n" );
-	for ( i; dim ) { printf( "%#x ", p[i] ); }
-	printf( "\n" );
-	free( p );
-
-	p = alloc( dim );                                   // CFA array alloc, type safe
-	for ( i; dim ) { p[i] = 0xdeadbeef; }
+	for ( i; dim ) { printf( "%#x ", ip[i] ); }
+	printf( "\n" );
+	free( ip );
+
+	ip = alloc( dim );									// CFA array alloc, type safe
+	for ( i; dim ) { ip[i] = 0xdeadbeef; }
 	printf( "CFA array alloc, no fill\n" );
-	for ( i; dim ) { printf( "%#x ", p[i] ); }
-	printf( "\n" );
-	free( p );
-
-	p = alloc_set( 2 * dim, fill );						// CFA array alloc, fill
+	for ( i; dim ) { printf( "%#x ", ip[i] ); }
+	printf( "\n" );
+	free( ip );
+
+	ip = alloc_set( 2 * dim, fill );					// CFA array alloc, fill
 	printf( "CFA array alloc, fill %#hhx\n", fill );
-	for ( i; 2 * dim ) { printf( "%#x ", p[i] ); }
-	printf( "\n" );
-	free( p );
-
-	p = alloc_set( 2 * dim, 0xdeadbeef );				// CFA array alloc, fill
+	for ( i; 2 * dim ) { printf( "%#x ", ip[i] ); }
+	printf( "\n" );
+	free( ip );
+
+	ip = alloc_set( 2 * dim, 0xdeadbeef );				// CFA array alloc, fill
 	printf( "CFA array alloc, fill %#hhx\n", 0xdeadbeef );
-	for ( i; 2 * dim ) { printf( "%#x ", p[i] ); }
-	printf( "\n" );
-	// do not free
-
-	p1 = alloc_set( 2 * dim, p );						// CFA array alloc, fill
+	for ( i; 2 * dim ) { printf( "%#x ", ip[i] ); }
+	printf( "\n" );
+	// do not free
+
+	ip1 = alloc_set( 2 * dim, ip );						// CFA array alloc, fill
 	printf( "CFA array alloc, fill from array\n" );
-	for ( i; 2 * dim ) { printf( "%#x %#x, ", p[i], p1[i] ); }
-	free( p1 );
-	printf( "\n" );
+	for ( i; 2 * dim ) { printf( "%#x %#x, ", ip[i], ip1[i] ); }
+	free( ip1 );
+	printf( "\n" );
+
+
+	// realloc, non-array types
+	printf( "\n" );
+
+	ip = (int *)realloc( ip, dim * sizeof(*ip) );		// C realloc
+	printf( "C realloc\n" );
+	for ( i; dim ) { printf( "%#x ", ip[i] ); }
+	printf( "\n" );
+	// do not free
+
+	ip = realloc( ip, 2 * dim * sizeof(*ip) );			// CFA realloc
+	for ( i; dim ~ 2 * dim ) { ip[i] = 0x1010101; }
+	printf( "CFA realloc\n" );
+	for ( i; 2 * dim ) { printf( "%#x ", ip[i] ); }
+	printf( "\n" );
+	// do not free
+
+
+	// realloc, array types
+	printf( "\n" );
+
+	ip = alloc( ip, dim );								// CFA realloc array alloc
+	for ( i; dim ) { ip[i] = 0xdeadbeef; }
+	printf( "CFA realloc array alloc\n" );
+	for ( i; dim ) { printf( "%#x ", ip[i] ); }
+	printf( "\n" );
+	// do not free
+
+	ip = alloc( ip, 2 * dim );							// CFA realloc array alloc
+	for ( i; dim ~ 2 * dim ) { ip[i] = 0x1010101; }		// fill upper part
+	printf( "CFA realloc array alloc\n" );
+	for ( i; 2 * dim ) { printf( "%#x ", ip[i] ); }
+	printf( "\n" );
+	// do not free
+
+	ip = alloc( ip, dim );								// CFA realloc array alloc
+	printf( "CFA realloc array alloc\n" );
+	for ( i; dim ) { printf( "%#x ", ip[i] ); }
+	printf( "\n" );
+	// do not free
+
+	ip = alloc_set( ip, 3 * dim, fill );				// CFA realloc array alloc, fill
+	printf( "CFA realloc array alloc, fill\n" );
+	for ( i; 3 * dim ) { printf( "%#x ", ip[i] ); }
+	printf( "\n" );
+	// do not free
+
+	ip = alloc_set( ip, dim, fill );					// CFA realloc array alloc, fill
+	printf( "CFA realloc array alloc, fill\n" );
+	for ( i; dim ) { printf( "%#x ", ip[i] ); }
+	printf( "\n" );
+	// do not free
+
+	ip = alloc_set( ip, 3 * dim, fill );				// CFA realloc array alloc, fill
+	printf( "CFA realloc array alloc, fill\n" );
+	for ( i; 3 * dim ) { printf( "%#x ", ip[i] );; }
+	printf( "\n" );
+	// do not free
+
+	ip = alloc_set( ip, 3 * dim, 5 );					// CFA realloc array alloc, 5
+	printf( "CFA realloc array alloc, 5\n" );
+	for ( i; 3 * dim ) { printf( "%#x ", ip[i] ); }
+	printf( "\n" );
+	// do not free
+
+	ip = alloc_set( ip, dim, 5 );						// CFA realloc array alloc, 5
+	printf( "CFA realloc array alloc, 5\n" );
+	for ( i; dim ) { printf( "%#x ", ip[i] ); }
+	printf( "\n" );
+	// do not free
+
+	ip = alloc_set( ip, 3 * dim, 5 );					// CFA realloc array alloc, 5
+	printf( "CFA realloc array alloc, 5\n" );
+	for ( i; 3 * dim ) { printf( "%#x ", ip[i] );; }
+	printf( "\n" );
+	free( ip );
 
 
 	// resize, non-array types
-	printf( "\n" );
-
-	p = (int *)realloc( p, dim * sizeof(*p) );			// C realloc
-	printf( "C realloc\n" );
-	for ( i; dim ) { printf( "%#x ", p[i] ); }
-	printf( "\n" );
-	// do not free
-
-	p = realloc( p, 2 * dim * sizeof(*p) );             // CFA realloc
-	for ( i; dim ~ 2 * dim ) { p[i] = 0x1010101; }
-	printf( "CFA realloc\n" );
-	for ( i; 2 * dim ) { printf( "%#x ", p[i] ); }
-	printf( "\n" );
-	// do not free
+
+	struct S {
+		int a[5];
+	};
+
+    ip = alloc();
+	*ip = 5;
+    double * dp = alloc( ip );
+	*dp = 5.5;
+    S * sp = alloc( dp );
+	*sp = (S){ {0, 1, 2, 3, 4} };
+    ip = alloc( sp );
+	*ip = 3;
+    free( ip );
 
 
 	// resize, array types
-	printf( "\n" );
-
-	p = alloc( p, dim );                                // CFA resize array alloc
-	for ( i; dim ) { p[i] = 0xdeadbeef; }
-	printf( "CFA resize array alloc\n" );
-	for ( i; dim ) { printf( "%#x ", p[i] ); }
-	printf( "\n" );
-	// do not free
-
-	p = alloc( p, 2 * dim );                            // CFA resize array alloc
-	for ( i; dim ~ 2 * dim ) { p[i] = 0x1010101; }		// fill upper part
-	printf( "CFA resize array alloc\n" );
-	for ( i; 2 * dim ) { printf( "%#x ", p[i] ); }
-	printf( "\n" );
-	// do not free
-
-	p = alloc( p, dim );                                // CFA resize array alloc
-	printf( "CFA resize array alloc\n" );
-	for ( i; dim ) { printf( "%#x ", p[i] ); }
-	printf( "\n" );
-	// do not free
-
-	p = alloc_set( p, 3 * dim, fill );					// CFA resize array alloc, fill
-	printf( "CFA resize array alloc\n" );
-	for ( i; 3 * dim ) { printf( "%#x ", p[i] ); }
-	printf( "\n" );
-	// do not free
-
-	p = alloc_set( p, dim, fill );						// CFA resize array alloc, fill
-	printf( "CFA resize array alloc\n" );
-	for ( i; dim ) { printf( "%#x ", p[i] ); }
-	printf( "\n" );
-	// do not free
-
-	p = alloc_set( p, 3 * dim, fill );					// CFA resize array alloc, fill
-	printf( "CFA resize array alloc, fill\n" );
-	for ( i; 3 * dim ) { printf( "%#x ", p[i] );; }
-	printf( "\n" );
-	free( p );
+
+    ip = alloc( 5 );
+	for ( i; 5 ) { ip[i] = 5; }
+    dp = alloc( ip, 5 );
+	for ( i; 5 ) { dp[i] = 5.5; }
+    sp = alloc( dp, 5 );
+	for ( i; 5 ) { sp[i] = (S){ {0, 1, 2, 3, 4} }; }
+    ip = alloc( sp, 3 );
+	for ( i; 3 ) { ip[i] = 3; }
+    ip = alloc( ip, 7 );
+	for ( i; 7 ) { ip[i] = 7; }
+    ip = alloc( ip, 7, false );
+	for ( i; 7 ) { ip[i] = 7; }
+    free( ip );
 
 
@@ -168,5 +220,5 @@
 	free( stp );
 
-	stp = &(*memalign( Alignment )){ 42, 42.5 };          // CFA memalign
+	stp = &(*memalign( Alignment )){ 42, 42.5 };		// CFA memalign
 	assert( (uintptr_t)stp % Alignment == 0 );
 	printf( "CFA memalign %d %g\n", stp->x, stp->y );
@@ -300,16 +352,15 @@
 	free( fp - 1 );
 
-	p = foo( bar( baz( malloc(), 0 ), 0 ), 0 );
-	*p = 0xdeadbeef;
-	printf( "CFA deep malloc %#x\n", *p );
-	free( p );
+	ip = foo( bar( baz( malloc(), 0 ), 0 ), 0 );
+	*ip = 0xdeadbeef;
+	printf( "CFA deep malloc %#x\n", *ip );
+	free( ip );
 
 #ifdef ERR1
 	stp = malloc();
 	printf( "\nSHOULD FAIL\n" );
-	p = realloc( stp, dim * sizeof( *stp ) );
-	p = alloc( stp, dim * sizeof( *stp ) );
-	p = memset( stp, 10 );
-	p = memcpy( &st1, &st );
+	ip = realloc( stp, dim * sizeof( *stp ) );
+	ip = memset( stp, 10 );
+	ip = memcpy( &st1, &st );
 #endif
 } // main
