Index: src/libcfa/heap.c
===================================================================
--- src/libcfa/heap.c	(revision 91788fa6e179ae25a8278f9ddc51d04624c41759)
+++ src/libcfa/heap.c	(revision f0b3f51fef07efa32e0bc86fc241753f438f52b0)
@@ -10,6 +10,6 @@
 // Created On       : Tue Dec 19 21:58:35 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Jul 25 16:42:02 2018
-// Update Count     : 438
+// Last Modified On : Thu Jul 26 22:28:23 2018
+// Update Count     : 449
 // 
 
@@ -111,4 +111,32 @@
 // 	return temp;
 // } // prtHeapTermOff
+
+
+#ifdef __CFA_DEBUG__
+static unsigned int allocfree;							// running total of allocations minus frees
+static unsigned int appStart;							// storage allocation when application starts
+
+static void checkUnfreed() {
+	unsigned int total = allocfree - appStart;
+    if ( total != 0 ) {
+		// DO NOT USE STREAMS AS THEY MAY BE UNAVAILABLE AT THIS POINT.
+		// char helpText[512];
+		// int len = snprintf( helpText, 512, "CFA warning (UNIX pid:%ld) : program terminating with %u(0x%x) bytes of storage allocated but not freed.\n"
+		// 					"Possible cause is unfreed storage allocated by the program or system/library routines called from the program.\n",
+		// 					(long int)getpid(), total, total ); // always print the UNIX pid
+		// __cfaabi_dbg_bits_write( helpText, len );
+    } // if
+} // checkUnfreed
+
+extern "C" {
+void heapAppStart() {									// called by __cfaabi_appready_startup
+	appStart = allocfree;
+} // heapAppStart
+
+void heapAppStop() {									// called by __cfaabi_appready_startdown
+	checkUnfreed();
+} // heapAppStop
+} // extern "C"
+#endif // __CFA_DEBUG__
 
 
@@ -139,33 +167,4 @@
 static int mmapFd = -1;									// fake or actual fd for anonymous file
 
-static unsigned int allocfree;							// running total of allocations minus frees
-static unsigned int appStart;							// storage allocation when application starts
-
-static void checkUnfreed() {
-	#ifdef __CFA_DEBUG__
-	unsigned int total = allocfree - appStart;
-    if ( total != 0 ) {
-		// DO NOT USE STREAMS AS THEY MAY BE UNAVAILABLE AT THIS POINT.
-		// char helpText[512];
-		// int len = snprintf( helpText, 512, "CFA warning (UNIX pid:%ld) : program terminating with %u(0x%x) bytes of storage allocated but not freed.\n"
-		// 					"Possible cause is unfreed storage allocated by the program or system/library routines called from the program.\n",
-		// 					(long int)getpid(), total, total ); // always print the UNIX pid
-		// __cfaabi_dbg_bits_write( helpText, len );
-    } // if
-	#endif // __CFA_DEBUG__
-} // checkUnfreed
-
-#ifdef __CFA_DEBUG__
-extern "C" {
-void heapAppStart() {									// called by __cfaabi_appready_startup
-	appStart = allocfree;
-} // heapAppStart
-
-void heapAppStop() {									// called by __cfaabi_appready_startdown
-	checkUnfreed();
-} // heapAppStop
-} // extern "C"
-#endif // __CFA_DEBUG__
-
 
 struct HeapManager {
@@ -178,7 +177,7 @@
 					union {
 						struct {						// 32-bit word => 64-bit header, 64-bit word => 128-bit header
-							#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ && __U_WORDSIZE__ == 32
+							#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ && __SIZEOF_POINTER__ == 4
 							uint32_t padding;			// unused, force home/blocksize to overlay alignment in fake header
-							#endif // __U_WORDSIZE__ == 32 && __U_WORDSIZE__ == 32
+							#endif // __ORDER_BIG_ENDIAN__ && __U_WORDSIZE__ == 32
 
 							union {
@@ -191,7 +190,7 @@
 							};
 
-							#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ && __U_WORDSIZE__ == 32
+							#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_POINTER__ == 4
 							uint32_t padding;			// unused, force home/blocksize to overlay alignment in fake header
-							#endif // __U_WORDSIZE__ == 32 && __U_WORDSIZE__ == 32
+							#endif // __ORDER_LITTLE_ENDIAN__ && __U_WORDSIZE__ == 32
 
 						};
@@ -204,5 +203,5 @@
 					#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
 					uint32_t alignment;					// low-order bits of home/blockSize used for tricks
-					#endif // __BYTE_ORDER__
+					#endif // __ORDER_LITTLE_ENDIAN__
 
 					uint32_t offset;
@@ -210,5 +209,5 @@
 					#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
 					uint32_t alignment;					// low-order bits of home/blockSize used for tricks
-					#endif // __BYTE_ORDER__
+					#endif // __ORDER_BIG_ENDIAN__
 				} fake;
 			} kind;
@@ -305,4 +304,5 @@
 	#endif // __CFA_DEBUG__
 
+	assert( heapManager.heapBegin == 0 );
 	heapManager{};
 } // memory_startup
@@ -672,5 +672,5 @@
 
 static inline void * malloc2( size_t size ) {			// necessary for malloc statistics
-    assert( heapManager.heapBegin != 0 ) ;				// heap started
+	assert( heapManager.heapBegin != 0 );
     void * area = doMalloc( size );
     if ( unlikely( area == 0 ) ) errno = ENOMEM;		// POSIX
