Index: libcfa/src/heap.cfa
===================================================================
--- libcfa/src/heap.cfa	(revision 4803a9016cdba3bca08efbcaa830f1c8726df52b)
+++ libcfa/src/heap.cfa	(revision b4aa1ab49003d184ed679ab13d03dfca28529bae)
@@ -10,6 +10,6 @@
 // Created On       : Tue Dec 19 21:58:35 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Dec 11 07:36:34 2020
-// Update Count     : 970
+// Last Modified On : Sun Dec 13 22:04:10 2020
+// Update Count     : 984
 //
 
@@ -490,8 +490,15 @@
 		// If the size requested is bigger than the current remaining storage, increase the size of the heap.
 
-		size_t increase = ceiling2( size > heapExpand ? size : heapExpand, libAlign() );
+		size_t increase = ceiling2( size > heapExpand ? size : heapExpand, pageSize );
 		if ( sbrk( increase ) == (void *)-1 ) {			// failed, no memory ?
 			unlock( extlock );
 			abort( NO_MEMORY_MSG, size );				// give up
+		} // if
+		if ( mprotect( (char *)heapEnd + heapRemaining, increase, PROT_READ | PROT_WRITE | PROT_EXEC ) ) {
+			enum { BufferSize = 128 };
+			char helpText[BufferSize];
+			// Do not call strerror( errno ) as it may call malloc.
+			int len = snprintf( helpText, BufferSize, "internal error, extend(), mprotect failure, heapEnd:%p size:%zd, errno:%d.", heapEnd, increase, errno );
+			__cfaabi_bits_write( STDERR_FILENO, helpText, len );
 		} // if
 		#ifdef __STATISTICS__
@@ -568,9 +575,9 @@
 		#endif // __STATISTICS__
 
-		block = (HeapManager.Storage *)mmap( 0, tsize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, mmapFd, 0 );
+		block = (HeapManager.Storage *)mmap( 0, tsize, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, mmapFd, 0 );
 		if ( block == (HeapManager.Storage *)MAP_FAILED ) { // failed ?
 			if ( errno == ENOMEM ) abort( NO_MEMORY_MSG, tsize ); // no memory
 			// Do not call strerror( errno ) as it may call malloc.
-			abort( "(HeapManager &)0x%p.doMalloc() : internal error, mmap failure, size:%zu error:%d.", &heapManager, tsize, errno );
+			abort( "(HeapManager &)0x%p.doMalloc() : internal error, mmap failure, size:%zu errno:%d.", &heapManager, tsize, errno );
 		} //if
 		#ifdef __CFA_DEBUG__
@@ -669,8 +676,8 @@
 		for ( HeapManager.Storage * p = freeLists[i].freeList; p != 0p; p = p->header.kind.real.next ) {
 		#else
-		// for ( HeapManager.Storage * p = top( freeLists[i].freeList ); p != 0p; p = (p)`next->top ) {
+			for(;;) {
+//		for ( HeapManager.Storage * p = top( freeLists[i].freeList ); p != 0p; p = (p)`next->top ) {
 //		for ( HeapManager.Storage * p = top( freeLists[i].freeList ); p != 0p; /* p = getNext( p )->top */) {
-		for ( HeapManager.Storage * p ;; /* p = getNext( p )->top */) {
-			HeapManager.Storage * temp = p->header.kind.real.next.top; // FIX ME: direct assignent fails, initialization works`
+//			HeapManager.Storage * temp = p->header.kind.real.next.top; // FIX ME: direct assignent fails, initialization works`
 //			typeof(p) temp = (( p )`next)->top;			// FIX ME: direct assignent fails, initialization works`
 //			p = temp;
@@ -716,5 +723,5 @@
 
 	char * end = (char *)sbrk( 0 );
-	heapBegin = heapEnd = sbrk( (char *)ceiling2( (long unsigned int)end, libAlign() ) - end ); // move start of heap to multiple of alignment
+	heapBegin = heapEnd = sbrk( (char *)ceiling2( (long unsigned int)end, pageSize ) - end ); // move start of heap to multiple of alignment
 } // HeapManager
 
