Index: libcfa/src/heap.cfa
===================================================================
--- libcfa/src/heap.cfa	(revision f67b983b3baf4ba1423051c025fbde100277dd65)
+++ libcfa/src/heap.cfa	(revision 447b0d2b78a565216fda1aae8b888fe3bc1640be)
@@ -1239,8 +1239,11 @@
 	size_t odsize = dataStorage( bsize, oaddr, header ); // data storage available in bucket
 
-	if ( oalign <= nalign && (uintptr_t)oaddr % nalign == 0 ) { // <= alignment and new alignment happens to match
-		if ( oalign > libAlign() ) {					// fake header ?
-			headerAddr( oaddr )->kind.fake.alignment = nalign | 1; // update alignment (could be the same)
-		} // if
+	if ( oalign == nalign && size <= odsize && odsize <= size * 2 ) { // <= alignment and new alignment are same, allow 50% wasted storage for smaller size
+		header->kind.real.blockSize &= -2;			// turn off 0 fill
+		header->kind.real.size = size;				// reset allocation size
+		return oaddr;
+	} // if
+	if ( oalign < nalign && (uintptr_t)oaddr % nalign == 0 && oalign > libAlign() ) { // <= alignment and new alignment happens to match, and oaddr has a fake header
+		headerAddr( oaddr )->kind.fake.alignment = nalign | 1; // update alignment (could be the same)
 		if ( size <= odsize && odsize <= size * 2 ) {	// allow 50% wasted storage for smaller size
 			header->kind.real.blockSize &= -2;			// turn off 0 fill
@@ -1282,8 +1285,9 @@
 	headers( "realloc", oaddr, header, freeElem, bsize, oalign );
 
-	if ( oalign <= nalign && (uintptr_t)oaddr % nalign == 0 ) { // <= alignment and new alignment happens to match
-		if ( oalign > libAlign() ) {					// fake header ?
-			headerAddr( oaddr )->kind.fake.alignment = nalign | 1; // update alignment (could be the same)
-		} // if
+	if ( oalign == nalign ) { // <= alignment and new alignment are same
+		return realloc( oaddr, size );
+	} // if
+	if ( oalign < nalign && (uintptr_t)oaddr % nalign == 0 && oalign > libAlign() ) { // <= alignment and new alignment happens to match, and oaddr has a fake header
+		headerAddr( oaddr )->kind.fake.alignment = nalign | 1; // update alignment (could be the same)
 		return realloc( oaddr, size );
 	} // if
Index: libcfa/src/stdlib.hfa
===================================================================
--- libcfa/src/stdlib.hfa	(revision f67b983b3baf4ba1423051c025fbde100277dd65)
+++ libcfa/src/stdlib.hfa	(revision 447b0d2b78a565216fda1aae8b888fe3bc1640be)
@@ -179,12 +179,9 @@
 
 		if ( Resize ) {
-//printf("1. $alloc_internal got: %p %p %lu %lu\n", Resize, Realloc, Align, Dim); // these prints are temporary
 			ptr = (T*) (void *) resize( (void *)Resize, Align, Dim * size );
 		} else if ( Realloc ) {
 			if (Fill.tag != '0') copy_end = min(malloc_size( Realloc ), Dim * size);
-//printf("2. $alloc_internal got: %p %p %lu %lu\n", Resize, Realloc, Align, Dim);
 			ptr = (T*) (void *) realloc( (void *)Realloc, Align, Dim * size );
 		} else {
-//printf("3. $alloc_internal got: %p %p %lu %lu\n", Resize, Realloc, Align, Dim);
 			ptr = (T*) (void *) memalign( Align, Dim * size );
 		}
