Index: src/tests/alloc.c
===================================================================
--- src/tests/alloc.c	(revision fab700bfdec33c1af1515286e6f49c5d0788c4ae)
+++ src/tests/alloc.c	(revision acd738aa4b3c107e0d22096954fcb98fa69acfe6)
@@ -10,6 +10,6 @@
 // Created On       : Wed Feb  3 07:56:22 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon May 29 11:33:15 2017
-// Update Count     : 228
+// Last Modified On : Thu Jun  1 21:33:49 2017
+// Update Count     : 315
 // 
 
@@ -18,4 +18,5 @@
 #include <malloc.h>										// malloc_usable_size
 #include <stdint.h>										// uintptr_t
+#include <stdlib.h>										// posix_memalign
 } // extern
 #include <fstream>
@@ -28,6 +29,6 @@
 int main( void ) {
     size_t dim = 10;
-    struct S { int x; double y; } * s;
     int * p;
+	char fill = '\1';
 
 	// allocation, non-array types
@@ -35,13 +36,19 @@
     p = (void *)malloc( sizeof(*p) );					// C malloc, type unsafe
 	*p = 0xdeadbeef;
-	printf( "C   malloc %x\n", *p );
+	printf( "C   malloc %#x\n", *p );
     free( p );
 
     p = malloc();										// CFA malloc, type safe
-	printf( "CFA malloc %d\n", *p );
-    free( p );
-
-    p = malloc( '\1' );									// CFA malloc, fill
-	printf( "CFA malloc, fill %08x\n", *p );
+	*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( fill );									// CFA alloc, fill
+	printf( "CFA alloc, fill %08x\n", *p );
 
 
@@ -50,24 +57,25 @@
 
     p = calloc( dim, sizeof( *p ) );					// C array calloc, type unsafe
-	printf( "C   calloc\n" );
-	for ( int i = 0; i < dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
+	printf( "C   array calloc, fill 0\n" );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] ); }
 	printf( "\n" );
     free( p );
 
     p = calloc( dim );									// CFA array calloc, type safe
-	printf( "CFA calloc\n" );
-	for ( int i = 0; i < dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
-	printf( "\n" );
-    free( p );
-
-    p = amalloc( dim );									// CFA array malloc, type safe
-	printf( "CFA array malloc\n" );
-	for ( int i = 0; i < dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
-	printf( "\n" );
-    free( p );
-
-    p = amalloc( 2 * dim, '\1' );						// CFA array malloc, fill
-	printf( "CFA array malloc\n" );
-	for ( int i = 0; i < 2 * dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
+	printf( "CFA array calloc, fill 0\n" );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] ); }
+	printf( "\n" );
+    free( p );
+
+    p = alloc( dim );									// CFA array alloc, type safe
+	for ( int i = 0; i < dim; i += 1 ) { p[i] = 0xdeadbeef; }
+	printf( "CFA array alloc, no fill\n" );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] ); }
+	printf( "\n" );
+    free( p );
+
+    p = alloc( 2 * dim, fill );							// CFA array alloc, fill
+	printf( "CFA array alloc, fill %#x\n", fill );
+	for ( int i = 0; i < 2 * dim; i += 1 ) { printf( "%#x ", p[i] ); }
 	printf( "\n" );
 	// do not free
@@ -77,32 +85,14 @@
 	printf( "\n" );
 
-    p = (void *)realloc( p, dim * sizeof(*p) );			// CFA realloc
-	printf( "C   realloc\n" );
-	for ( int i = 0; i < dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
+    p = (void *)realloc( p, dim * sizeof(*p) );			// C realloc
+	for ( int i = 0; i < dim; i += 1 ) { p[i] = 0xdeadbeef; }
+	printf( "C   realloc %ld\n", malloc_usable_size( p ) );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] ); }
 	printf( "\n" );
 
     p = realloc( p, 2 * dim * sizeof(*p) );				// CFA realloc
-	printf( "CFA realloc\n" );
-	for ( int i = 0; i < 2 * dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
-	printf( "\n" );
-
-    p = realloc( p, dim * sizeof(*p), '\1' );			// CFA realloc
-	printf( "CFA realloc\n" );
-	for ( int i = 0; i < dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
-	printf( "\n" );
-
-    p = malloc( p, dim * sizeof(*p) );					// CFA malloc
-	printf( "CFA resize malloc\n" );
-	for ( int i = 0; i < dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
-	printf( "\n" );
-
-    p = malloc( p, 2 * dim * sizeof(*p), '\1' );		// CFA malloc, fill
-	printf( "CFA resize malloc, fill\n" );
-	for ( int i = 0; i < 2 * dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
-	printf( "\n" );
-
-    p = malloc( p, dim * sizeof(*p), '\1' );			// CFA malloc, fill
-	printf( "CFA resize malloc, fill\n" );
-	for ( int i = 0; i < dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
+	for ( int i = dim; i < 2 * dim; i += 1 ) { p[i] = 0x1010101; }
+	printf( "CFA realloc %ld\n", malloc_usable_size( p ) );
+	for ( int i = 0; i < 2 * dim; i += 1 ) { printf( "%#x ", p[i] ); }
 	printf( "\n" );
 	// do not free
@@ -112,43 +102,62 @@
 	printf( "\n" );
 
-    p = amalloc( p, 2 * dim );							// CFA array malloc
-	printf( "CFA resize array malloc\n" );
-	for ( int i = 0; i < 2 * dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
-	printf( "\n" );
-
-    p = amalloc( p, dim );								// CFA array malloc
-	printf( "CFA resize array malloc\n" );
-	for ( int i = 0; i < dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
-	printf( "\n" );
-
-    p = amalloc( p, 2 * dim, '\1' );					// CFA array malloc, fill
-	printf( "CFA resize array malloc, fill\n" );
-	for ( int i = 0; i < 2 * dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
-	printf( "\n" );
-
-    p = amalloc( p, dim, '\1' );						// CFA array malloc, fill
-	printf( "CFA resize array malloc, fill\n" );
-	for ( int i = 0; i < dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
+    p = alloc( p, dim );								// CFA resize array alloc
+	for ( int i = 0; i < dim; i += 1 ) { p[i] = 0xdeadbeef; }
+	printf( "CFA resize alloc %ld\n", malloc_usable_size( p ) );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] ); }
+	printf( "\n" );
+
+    p = alloc( p, 2 * dim );							// CFA resize array alloc
+	for ( int i = dim; i < 2 * dim; i += 1 ) { p[i] = 0x1010101; }
+	printf( "CFA resize array alloc %ld\n", malloc_usable_size( p ) );
+	for ( int i = 0; i < 2 * dim; i += 1 ) { printf( "%#x ", p[i] ); }
+	printf( "\n" );
+
+    p = alloc( p, dim );								// CFA array alloc
+	printf( "CFA resize array alloc %ld\n", malloc_usable_size( p ) );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] ); }
+	printf( "\n" );
+
 	free( p );
-	printf( "\n" );
+	p = 0;
+
+    p = alloc( p, dim, fill );							// CFA array alloc, fill
+	printf( "CFA resize array alloc %ld, fill\n", malloc_usable_size( p ) );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] ); }
+	printf( "\n" );
+
+    p = alloc( p, 2 * dim, fill );						// CFA array alloc, fill
+	printf( "CFA resize array alloc %ld, fill\n", malloc_usable_size( p ) );
+	for ( int i = 0; i < 2 * dim; i += 1 ) { printf( "%#x ", p[i] ); }
+	printf( "\n" );
+
+    p = alloc( p, dim, fill );							// CFA array alloc, fill
+	printf( "CFA resize array alloc %ld, fill\n", malloc_usable_size( p ) );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] );; }
+	printf( "\n" );
+	free( p );
+
 
     struct Struct { int x; double y; };
-    Struct st, st1, sta[dim], sta1[dim], * stp;
-
+    Struct st, st1, sta[dim], sta1[dim], * stp, * stp1;
 
 	// alignment, non-array types
 	printf( "\n" );
-
 	enum { Alignment = 128 };
-    stp = aligned_alloc( Alignment );					// CFA aligned_alloc
+
+    stp = (memalign( Alignment, sizeof( *stp ) ) ){ 42, 42.5 }; // C memalign
+	assert( (uintptr_t)stp % Alignment == 0 );
+	printf( "C   memalign %d %g\n", stp->x, stp->y );
+    free( stp );
+
+    stp = (memalign( Alignment )){ 42, 42.5 };			// CFA memalign
+	assert( (uintptr_t)stp % Alignment == 0 );
+	printf( "CFA memalign %d %g\n", stp->x, stp->y );
+    free( stp );
+
+    posix_memalign( (void **)&stp, Alignment, sizeof( *stp ) );	// C posix_memalign
 	*stp = (Struct){ 42, 42.5 };
 	assert( (uintptr_t)stp % Alignment == 0 );
-	printf( "CFA aligned_alloc %d %g\n", stp->x, stp->y );
-    free( stp );
-
-    stp = memalign( Alignment );						// CFA memalign
-	*stp = (Struct){ 42, 42.5 };
-	assert( (uintptr_t)stp % Alignment == 0 );
-	printf( "CFA memalign %d %g\n", stp->x, stp->y );
+	printf( "CFA posix_memalign %d %g\n", stp->x, stp->y );
     free( stp );
 
@@ -159,7 +168,17 @@
     free( stp );
 
-    stp = memalign( Alignment, '\1' );					// CFA memalign, fill
-	assert( (uintptr_t)stp % Alignment == 0 );
-	printf( "CFA memalign fill %d %g\n", stp->x, stp->y );
+    stp = (aligned_alloc( Alignment )){ 42, 42.5 };		// CFA aligned_alloc
+	assert( (uintptr_t)stp % Alignment == 0 );
+	printf( "CFA aligned_alloc %d %g\n", stp->x, stp->y );
+    free( stp );
+
+    stp = (align_alloc( Alignment )){ 42, 42.5 };		// CFA align_alloc
+	assert( (uintptr_t)stp % Alignment == 0 );
+	printf( "CFA align_alloc %d %g\n", stp->x, stp->y );
+    free( stp );
+
+    stp = align_alloc( Alignment, fill );				// CFA memalign, fill
+	assert( (uintptr_t)stp % Alignment == 0 );
+	printf( "CFA align_alloc fill %#x %a\n", stp->x, stp->y );
     free( stp );
 
@@ -168,15 +187,16 @@
 	printf( "\n" );
 
-    stp = amemalign( Alignment, 2 * dim );				// CFA array memalign
-	assert( (uintptr_t)stp % Alignment == 0 );
-	printf( "CFA memalign array\n" );
-	for ( int i = 0; i < 2 * dim; i += 1 ) { printf( "%x %g, ", stp[i].x, stp[i].y ); stp[i].x = 0Xdeadbeef, stp[i].y = -17.2; }
-	printf( "\n" );
-    free( stp );
-
-    stp = amemalign( Alignment, dim, '\1' );			// CFA array memalign, fill
-	assert( (uintptr_t)stp % Alignment == 0 );
-	printf( "CFA memalign array\n" );
-	for ( int i = 0; i < dim; i += 1 ) { printf( "%x %g, ", stp[i].x, stp[i].y ); stp[i].x = 0Xdeadbeef, stp[i].y = -17.2; }
+    stp = align_alloc( Alignment, dim );				// CFA array memalign
+	assert( (uintptr_t)stp % Alignment == 0 );
+	for ( int i = 0; i < dim; i += 1 ) { stp[i] = (Struct){ 42, 42.5 }; }
+	printf( "CFA array align_alloc\n" );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%d %g, ", stp[i].x, stp[i].y ); }
+	printf( "\n" );
+    free( stp );
+
+    stp = align_alloc( Alignment, dim, fill );			// CFA array memalign, fill
+	assert( (uintptr_t)stp % Alignment == 0 );
+	printf( "CFA array align_alloc, fill\n" );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%#x %a, ", stp[i].x, stp[i].y ); }
 	printf( "\n" );
     free( stp );
@@ -186,8 +206,8 @@
 	printf( "\n" );
 
-    stp = memset( &st, '\xff' );						// CFA memset, type safe
-	printf( "CFA memset %x %g\n", st.x, st.y );
-    stp = memcpy( &st1, &st );							// CFA memcpy, type safe
-	printf( "CFA memcpy %x %g\n", st1.x, st1.y );
+    memset( &st, fill );								// CFA memset, type safe
+	printf( "CFA memset %#x %a\n", st.x, st.y );
+    memcpy( &st1, &st );								// CFA memcpy, type safe
+	printf( "CFA memcpy %#x %a\n", st1.x, st1.y );
 
 
@@ -195,12 +215,34 @@
 	printf( "\n" );
 
-    stp = amemset( sta, dim, '\xff' );					// CFA array memset, type safe
+    memset( sta, dim, fill );							// CFA array memset, type safe
 	printf( "CFA array memset\n" );
-	for ( int i = 0; i < dim; i += 1 ) { printf( "%x %g, ", sta[i].x, sta[i].y ); sta[i].x = 0Xdeadbeef, sta[i].y = -17.2; }
-	printf( "\n" );
-
-    stp = amemcpy( sta1, sta, dim );					// CFA array memcpy, type safe
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%#x %a, ", sta[i].x, sta[i].y ); }
+	printf( "\n" );
+
+    memcpy( sta1, sta, dim );							// CFA array memcpy, type safe
 	printf( "CFA memcpy\n" );
-	for ( int i = 0; i < dim; i += 1 ) { printf( "%x %g, ", sta1[i].x, sta1[i].y ); sta1[i].x = 0Xdeadbeef, sta1[i].y = -17.2; }
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%#x %a, ", sta1[i].x, sta1[i].y ); }
+	printf( "\n" );
+
+
+	// new, non-array types
+	printf( "\n" );
+
+	stp = new( 42, 42.5 );
+	stp1 = new( 42, 42.5 );
+	printf( "CFA new initialize\n%d %g %d %g\n", stp->x, stp->y, stp1->x, stp1->y );
+	delete( stp, stp1 );
+
+	// new, array types
+	stp = anew( dim, 42, 42.5 );
+	printf( "CFA array new initialize\n" );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%d %g, ", stp[i].x, stp[i].y ); }
+	printf( "\n" );
+	stp1 = anew( dim, 42, 42.5 );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%d %g, ", stp1[i].x, stp1[i].y ); }
+	printf( "\n" );
+	adelete( dim, stp, dim, stp1 );
+
+	// extras
 	printf( "\n" );
 
@@ -211,10 +253,10 @@
     p = foo( bar( baz( malloc(), 0 ), 0 ), 0 );
 	*p = 0xdeadbeef;
-	printf( "CFA deep malloc %x\n", *p );
+	printf( "CFA deep malloc %#x\n", *p );
     free( p );
 
 	stp = malloc();
 	printf( "\nSHOULD FAIL\n" );
-    p = malloc( stp, dim * sizeof(*stp) );
+    p = alloc( stp, dim * sizeof(*stp) );
     p = memset( stp, 10 );
     p = memcpy( &st1, &st );
