Index: libcfa/src/stdlib.hfa
===================================================================
--- libcfa/src/stdlib.hfa	(revision d5d3a90b22aaaa0979ed8f696f3909a2c8633243)
+++ libcfa/src/stdlib.hfa	(revision 60062be738bff68ce5a9b49899e33e83fadeac06)
@@ -10,6 +10,6 @@
 // Created On       : Thu Jan 28 17:12:35 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Jul 21 07:58:05 2020
-// Update Count     : 475
+// Last Modified On : Thu Jul 30 16:14:58 2020
+// Update Count     : 490
 //
 
@@ -71,10 +71,12 @@
 	T * resize( T * ptr, size_t size ) {				// CFA resize, eliminate return-type cast
 		$RE_SPECIALS( ptr, size, malloc, memalign );
-		return (T *)(void *)resize( (void *)ptr, size ); // CFA resize
+		if ( _Alignof(T) <= libAlign() ) return (T *)(void *)resize( (void *)ptr, size ); // CFA resize
+		else return (T *)(void *)resize( (void *)ptr, _Alignof(T), size ); // CFA resize
 	} // resize
 
 	T * realloc( T * ptr, size_t size ) {				// CFA realloc, eliminate return-type cast
 		$RE_SPECIALS( ptr, size, malloc, memalign );
-		return (T *)(void *)realloc( (void *)ptr, size ); // C realloc
+		if ( _Alignof(T) <= libAlign() ) return (T *)(void *)realloc( (void *)ptr, size ); // C realloc
+		else return (T *)(void *)realloc( (void *)ptr, _Alignof(T), size ); // CFA realloc
 	} // realloc
 
@@ -121,15 +123,8 @@
 	forall( dtype S | sized(S) )
 	T * alloc( S ptr[], size_t dim = 1 ) {				// singleton/array resize
-		size_t len = malloc_usable_size( ptr );			// current bucket size
-		if ( sizeof(T) * dim > len ) {					// not enough space ?
-			T * temp = alloc( dim );					// new storage
-			free( ptr );								// free old storage
-			return temp;
-		} else {
-			return (T *)ptr;
-		} // if
-	} // alloc
-
-	T * alloc( T ptr[], size_t dim, bool copy = true ) {
+		return resize( (T *)ptr, dim * sizeof(T) );		// CFA resize
+	} // alloc
+
+	T * alloc( T ptr[], size_t dim = 1, bool copy = true ) {
 		if ( copy ) {
 			return realloc( ptr, dim * sizeof(T) );		// CFA realloc
@@ -168,5 +163,5 @@
 			memset( (char *)nptr + osize, (int)fill, nsize - osize ); // initialize added storage
 		} // if
-		return (T *)nptr;
+		return nptr;
 	} // alloc_set
 
@@ -181,5 +176,5 @@
 			} // for
 		} // if
-		return (T *)nptr;
+		return nptr;
 	} // alloc_align_set
 } // distribution
@@ -195,5 +190,5 @@
 
 	T * alloc_align( T * ptr, size_t align ) {			// aligned realloc array
-		return (T *)(void *)realloc( (void *)ptr, align, sizeof(T) ); // CFA realloc
+		return (T *)(void *)realloc( (void *)ptr, align, sizeof(T) ); // CFA C realloc
 	} // alloc_align
 
@@ -232,9 +227,9 @@
 		size_t osize = malloc_size( ptr );				// current allocation
 		size_t nsize = dim * sizeof(T);					// new allocation
-		T * nptr = alloc_align( ptr, align, nsize );	// CFA alloc_align
+		T * nptr = alloc_align( ptr, align, nsize );
 		if ( nsize > osize ) {							// larger ?
 			memset( (char *)nptr + osize, (int)fill, nsize - osize ); // initialize added storage
 		} // if
-		return (T *)nptr;
+		return nptr;
 	} // alloc_align_set
 
@@ -243,5 +238,5 @@
 		size_t nsize = dim * sizeof(T);					// new allocation
 		size_t ndim = nsize / sizeof(T);				// new dimension
-		T * nptr = alloc_align( ptr, align, nsize );		// CFA alloc_align
+		T * nptr = alloc_align( ptr, align, nsize );
 		if ( ndim > odim ) {							// larger ?
 			for ( i; odim ~ ndim ) {
@@ -249,5 +244,5 @@
 			} // for
 		} // if
-		return (T *)nptr;
+		return nptr;
 	} // alloc_align_set
 } // distribution
