Index: libcfa/src/concurrency/alarm.cfa
===================================================================
--- libcfa/src/concurrency/alarm.cfa	(revision ee0bfa98a0c20dc13ba31575bd53582180239cf4)
+++ libcfa/src/concurrency/alarm.cfa	(revision fa35958abc0942e783f01f10de4587d2e962815b)
@@ -10,6 +10,6 @@
 // Created On       : Fri Jun 2 11:31:25 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri May 25 06:25:47 2018
-// Update Count     : 67
+// Last Modified On : Tue Dec  3 22:47:24 2019
+// Update Count     : 68
 //
 
@@ -40,5 +40,5 @@
 void __kernel_set_timer( Duration alarm ) {
 	verifyf(alarm >= 1`us || alarm == 0, "Setting timer to < 1us (%jins)", alarm.tv);
-	setitimer( ITIMER_REAL, &(itimerval){ alarm }, NULL );
+	setitimer( ITIMER_REAL, &(itimerval){ alarm }, 0p );
 }
 
@@ -113,5 +113,5 @@
 			this->tail = &this->head;
 		}
-		head->next = NULL;
+		head->next = 0p;
 	}
 	verify( validate( this ) );
@@ -127,5 +127,5 @@
 		this->tail = it;
 	}
-	n->next = NULL;
+	n->next = 0p;
 
 	verify( validate( this ) );
Index: libcfa/src/concurrency/coroutine.hfa
===================================================================
--- libcfa/src/concurrency/coroutine.hfa	(revision ee0bfa98a0c20dc13ba31575bd53582180239cf4)
+++ libcfa/src/concurrency/coroutine.hfa	(revision fa35958abc0942e783f01f10de4587d2e962815b)
@@ -10,6 +10,6 @@
 // Created On       : Mon Nov 28 12:27:26 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jun 21 17:49:39 2019
-// Update Count     : 9
+// Last Modified On : Tue Dec  3 22:47:58 2019
+// Update Count     : 10
 //
 
@@ -38,9 +38,9 @@
 void ^?{}( coroutine_desc & this );
 
-static inline void ?{}( coroutine_desc & this)                                       { this{ "Anonymous Coroutine", NULL, 0 }; }
-static inline void ?{}( coroutine_desc & this, size_t stackSize)                     { this{ "Anonymous Coroutine", NULL, stackSize }; }
+static inline void ?{}( coroutine_desc & this)                                       { this{ "Anonymous Coroutine", 0p, 0 }; }
+static inline void ?{}( coroutine_desc & this, size_t stackSize)                     { this{ "Anonymous Coroutine", 0p, stackSize }; }
 static inline void ?{}( coroutine_desc & this, void * storage, size_t storageSize )  { this{ "Anonymous Coroutine", storage, storageSize }; }
-static inline void ?{}( coroutine_desc & this, const char * name)                    { this{ name, NULL, 0 }; }
-static inline void ?{}( coroutine_desc & this, const char * name, size_t stackSize ) { this{ name, NULL, stackSize }; }
+static inline void ?{}( coroutine_desc & this, const char * name)                    { this{ name, 0p, 0 }; }
+static inline void ?{}( coroutine_desc & this, const char * name, size_t stackSize ) { this{ name, 0p, stackSize }; }
 
 //-----------------------------------------------------------------------------
@@ -89,5 +89,5 @@
 	src->state = Active;
 
-	if( unlikely(src->cancellation != NULL) ) {
+	if( unlikely(src->cancellation != 0p) ) {
 		_CtxCoroutine_Unwind(src->cancellation, src);
 	}
@@ -128,5 +128,5 @@
 	coroutine_desc * dst = get_coroutine(cor);
 
-	if( unlikely(dst->context.SP == NULL) ) {
+	if( unlikely(dst->context.SP == 0p) ) {
 		__stack_prepare(&dst->stack, 65000);
 		CtxStart(&cor, CtxInvokeCoroutine);
Index: libcfa/src/concurrency/invoke.h
===================================================================
--- libcfa/src/concurrency/invoke.h	(revision ee0bfa98a0c20dc13ba31575bd53582180239cf4)
+++ libcfa/src/concurrency/invoke.h	(revision fa35958abc0942e783f01f10de4587d2e962815b)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Nov 28 22:34:07 2019
-// Update Count     : 41
+// Last Modified On : Wed Dec  4 08:05:32 2019
+// Update Count     : 43
 //
 
@@ -208,5 +208,5 @@
 
 		static inline void ?{}(__monitor_group_t & this) {
-			(this.data){NULL};
+			(this.data){0p};
 			(this.size){0};
 			(this.func){NULL};
Index: libcfa/src/concurrency/kernel.cfa
===================================================================
--- libcfa/src/concurrency/kernel.cfa	(revision ee0bfa98a0c20dc13ba31575bd53582180239cf4)
+++ libcfa/src/concurrency/kernel.cfa	(revision fa35958abc0942e783f01f10de4587d2e962815b)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sun Dec  1 17:52:57 2019
-// Update Count     : 45
+// Last Modified On : Tue Dec  3 21:46:54 2019
+// Update Count     : 49
 //
 
@@ -27,4 +27,5 @@
 #include <unistd.h>
 #include <limits.h>										// PTHREAD_STACK_MIN
+#include <sys/mman.h>									// mprotect
 }
 
@@ -281,10 +282,8 @@
 
 		thread_desc * readyThread = 0p;
-		for( unsigned int spin_count = 0; ! __atomic_load_n(&this->do_terminate, __ATOMIC_SEQ_CST); spin_count++ )
-		{
+		for( unsigned int spin_count = 0; ! __atomic_load_n(&this->do_terminate, __ATOMIC_SEQ_CST); spin_count++ ) {
 			readyThread = nextThread( this->cltr );
 
-			if(readyThread)
-			{
+			if(readyThread) {
 				verify( ! kernelTLS.preemption_state.enabled );
 
@@ -297,7 +296,5 @@
 
 				spin_count = 0;
-			}
-			else
-			{
+			} else {
 				// spin(this, &spin_count);
 				halt(this);
@@ -445,5 +442,5 @@
 
 static void Abort( int ret, const char * func ) {
-	if ( ret ) {
+	if ( ret ) {										// pthread routines return errno values
 		abort( "%s : internal error, error(%d) %s.", func, ret, strerror( ret ) );
 	} // if
@@ -455,14 +452,19 @@
 	Abort( pthread_attr_init( &attr ), "pthread_attr_init" ); // initialize attribute
 
+	size_t stacksize;
+	 // default stack size, normally defined by shell limit
+	Abort( pthread_attr_getstacksize( &attr, &stacksize ), "pthread_attr_getstacksize" );
+	assert( stacksize >= PTHREAD_STACK_MIN );
+
 #ifdef __CFA_DEBUG__
-	size_t guardsize;
-	Abort( pthread_attr_getguardsize( &attr, &guardsize ), "pthread_attr_getguardsize" );
-	Abort( pthread_attr_setguardsize( &attr, guardsize ), "pthread_attr_setguardsize" );
+	void * stack = memalign( __page_size, stacksize + __page_size );
+	// pthread has no mechanism to create the guard page in user supplied stack.
+	if ( mprotect( stack, __page_size, PROT_NONE ) == -1 ) {
+		abort( "mprotect : internal error, mprotect failure, error(%d) %s.", errno, strerror( errno ) );
+	} // if
+#else
+	void * stack = malloc( stacksize );
 #endif
 
-	size_t stacksize;
-	Abort( pthread_attr_getstacksize( &attr, &stacksize ), "pthread_attr_getstacksize" ); // default stack size, normally defined by shell limit
-	assert( stacksize >= PTHREAD_STACK_MIN );
-	void * stack = malloc( stacksize );
 	Abort( pthread_attr_setstack( &attr, stack, stacksize ), "pthread_attr_setstack" ); 
 
Index: libcfa/src/concurrency/kernel.hfa
===================================================================
--- libcfa/src/concurrency/kernel.hfa	(revision ee0bfa98a0c20dc13ba31575bd53582180239cf4)
+++ libcfa/src/concurrency/kernel.hfa	(revision fa35958abc0942e783f01f10de4587d2e962815b)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Nov 28 21:24:12 2019
-// Update Count     : 17
+// Last Modified On : Wed Dec  4 07:54:51 2019
+// Update Count     : 18
 //
 
@@ -89,6 +89,6 @@
 static inline void ?{}(FinishAction & this) {
 	this.action_code = No_Action;
-	this.thrd = NULL;
-	this.lock = NULL;
+	this.thrd = 0p;
+	this.lock = 0p;
 }
 static inline void ^?{}(FinishAction &) {}
Index: libcfa/src/concurrency/monitor.cfa
===================================================================
--- libcfa/src/concurrency/monitor.cfa	(revision ee0bfa98a0c20dc13ba31575bd53582180239cf4)
+++ libcfa/src/concurrency/monitor.cfa	(revision fa35958abc0942e783f01f10de4587d2e962815b)
@@ -10,6 +10,6 @@
 // Created On       : Thd Feb 23 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Mar 30 14:30:26 2018
-// Update Count     : 9
+// Last Modified On : Wed Dec  4 07:55:14 2019
+// Update Count     : 10
 //
 
@@ -363,5 +363,5 @@
 	this.waiting_thread = waiting_thread;
 	this.count = count;
-	this.next = NULL;
+	this.next = 0p;
 	this.user_info = user_info;
 }
@@ -369,7 +369,7 @@
 void ?{}(__condition_criterion_t & this ) with( this ) {
 	ready  = false;
-	target = NULL;
-	owner  = NULL;
-	next   = NULL;
+	target = 0p;
+	owner  = 0p;
+	next   = 0p;
 }
 
@@ -378,5 +378,5 @@
 	this.target = target;
 	this.owner  = &owner;
-	this.next   = NULL;
+	this.next   = 0p;
 }
 
@@ -387,5 +387,5 @@
 
 	// Check that everything is as expected
-	assertf( this.monitors != NULL, "Waiting with no monitors (%p)", this.monitors );
+	assertf( this.monitors != 0p, "Waiting with no monitors (%p)", this.monitors );
 	verifyf( this.monitor_count != 0, "Waiting with 0 monitors (%"PRIiFAST16")", this.monitor_count );
 	verifyf( this.monitor_count < 32u, "Excessive monitor count (%"PRIiFAST16")", this.monitor_count );
@@ -449,5 +449,5 @@
 
 	// Lock all monitors
-	lock_all( this.monitors, NULL, count );
+	lock_all( this.monitors, 0p, count );
 
 	//Pop the head of the waiting queue
@@ -471,5 +471,5 @@
 
 	//Check that everything is as expected
-	verifyf( this.monitors != NULL, "Waiting with no monitors (%p)", this.monitors );
+	verifyf( this.monitors != 0p, "Waiting with no monitors (%p)", this.monitors );
 	verifyf( this.monitor_count != 0, "Waiting with 0 monitors (%"PRIiFAST16")", this.monitor_count );
 
@@ -674,6 +674,6 @@
 
 static inline void reset_mask( monitor_desc * this ) {
-	this->mask.accepted = NULL;
-	this->mask.data = NULL;
+	this->mask.accepted = 0p;
+	this->mask.data = 0p;
 	this->mask.size = 0;
 }
@@ -816,6 +816,6 @@
 	}
 
-	__cfaabi_dbg_print_safe( "Kernel :  Runing %i (%p)\n", ready2run, ready2run ? node->waiting_thread : NULL );
-	return ready2run ? node->waiting_thread : NULL;
+	__cfaabi_dbg_print_safe( "Kernel :  Runing %i (%p)\n", ready2run, ready2run ? node->waiting_thread : 0p );
+	return ready2run ? node->waiting_thread : 0p;
 }
 
@@ -824,5 +824,5 @@
 	if( !this.monitors ) {
 		// __cfaabi_dbg_print_safe( "Branding\n" );
-		assertf( thrd->monitors.data != NULL, "No current monitor to brand condition %p", thrd->monitors.data );
+		assertf( thrd->monitors.data != 0p, "No current monitor to brand condition %p", thrd->monitors.data );
 		this.monitor_count = thrd->monitors.size;
 
Index: libcfa/src/concurrency/monitor.hfa
===================================================================
--- libcfa/src/concurrency/monitor.hfa	(revision ee0bfa98a0c20dc13ba31575bd53582180239cf4)
+++ libcfa/src/concurrency/monitor.hfa	(revision fa35958abc0942e783f01f10de4587d2e962815b)
@@ -10,6 +10,6 @@
 // Created On       : Thd Feb 23 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Oct  7 18:06:45 2017
-// Update Count     : 10
+// Last Modified On : Wed Dec  4 07:55:32 2019
+// Update Count     : 11
 //
 
@@ -31,10 +31,10 @@
 	entry_queue{};
 	signal_stack{};
-	owner         = NULL;
+	owner         = 0p;
 	recursion     = 0;
-	mask.accepted = NULL;
-	mask.data     = NULL;
+	mask.accepted = 0p;
+	mask.data     = 0p;
 	mask.size     = 0;
-	dtor_node     = NULL;
+	dtor_node     = 0p;
 }
 
@@ -122,5 +122,5 @@
 
 static inline void ?{}( condition & this ) {
-	this.monitors = NULL;
+	this.monitors = 0p;
 	this.monitor_count = 0;
 }
Index: libcfa/src/concurrency/mutex.cfa
===================================================================
--- libcfa/src/concurrency/mutex.cfa	(revision ee0bfa98a0c20dc13ba31575bd53582180239cf4)
+++ libcfa/src/concurrency/mutex.cfa	(revision fa35958abc0942e783f01f10de4587d2e962815b)
@@ -11,7 +11,7 @@
 // Author           : Thierry Delisle
 // Created On       : Fri May 25 01:37:11 2018
-// Last Modified By : Thierry Delisle
-// Last Modified On : Fri May 25 01:37:51 2018
-// Update Count     : 0
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed Dec  4 09:16:39 2019
+// Update Count     : 1
 //
 
@@ -73,5 +73,5 @@
 	this.lock{};
 	this.blocked_threads{};
-	this.owner = NULL;
+	this.owner = 0p;
 	this.recursion_count = 0;
 }
@@ -83,5 +83,5 @@
 void lock(recursive_mutex_lock & this) with(this) {
 	lock( lock __cfaabi_dbg_ctx2 );
-	if( owner == NULL ) {
+	if( owner == 0p ) {
 		owner = kernelTLS.this_thread;
 		recursion_count = 1;
@@ -101,5 +101,5 @@
 	bool ret = false;
 	lock( lock __cfaabi_dbg_ctx2 );
-	if( owner == NULL ) {
+	if( owner == 0p ) {
 		owner = kernelTLS.this_thread;
 		recursion_count = 1;
Index: libcfa/src/concurrency/mutex.hfa
===================================================================
--- libcfa/src/concurrency/mutex.hfa	(revision ee0bfa98a0c20dc13ba31575bd53582180239cf4)
+++ libcfa/src/concurrency/mutex.hfa	(revision fa35958abc0942e783f01f10de4587d2e962815b)
@@ -11,7 +11,7 @@
 // Author           : Thierry Delisle
 // Created On       : Fri May 25 01:24:09 2018
-// Last Modified By : Thierry Delisle
-// Last Modified On : Fri May 25 01:24:12 2018
-// Update Count     : 0
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed Dec  4 09:16:53 2019
+// Update Count     : 1
 //
 
@@ -110,5 +110,5 @@
 
 	static inline void ?{}(lock_scope(L) & this) {
-		this.locks = NULL;
+		this.locks = 0p;
 		this.count = 0;
 	}
Index: libcfa/src/concurrency/thread.cfa
===================================================================
--- libcfa/src/concurrency/thread.cfa	(revision ee0bfa98a0c20dc13ba31575bd53582180239cf4)
+++ libcfa/src/concurrency/thread.cfa	(revision fa35958abc0942e783f01f10de4587d2e962815b)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Mar 30 17:19:52 2018
-// Update Count     : 8
+// Last Modified On : Wed Dec  4 09:17:49 2019
+// Update Count     : 9
 //
 
@@ -33,5 +33,5 @@
 // Thread ctors and dtors
 void ?{}(thread_desc & this, const char * const name, cluster & cl, void * storage, size_t storageSize ) with( this ) {
-	context{ NULL, NULL };
+	context{ 0p, 0p };
 	self_cor{ name, storage, storageSize };
 	state = Start;
@@ -41,8 +41,8 @@
 	self_mon_p = &self_mon;
 	curr_cluster = &cl;
-	next = NULL;
+	next = 0p;
 
-	node.next = NULL;
-	node.prev = NULL;
+	node.next = 0p;
+	node.prev = 0p;
 	doregister(curr_cluster, this);
 
Index: libcfa/src/concurrency/thread.hfa
===================================================================
--- libcfa/src/concurrency/thread.hfa	(revision ee0bfa98a0c20dc13ba31575bd53582180239cf4)
+++ libcfa/src/concurrency/thread.hfa	(revision fa35958abc0942e783f01f10de4587d2e962815b)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jan 17 12:27:26 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jun 21 17:51:33 2019
-// Update Count     : 5
+// Last Modified On : Wed Dec  4 09:18:14 2019
+// Update Count     : 6
 //
 
@@ -61,13 +61,13 @@
 void ^?{}(thread_desc & this);
 
-static inline void ?{}(thread_desc & this)                                                                  { this{ "Anonymous Thread", *mainCluster, NULL, 65000 }; }
-static inline void ?{}(thread_desc & this, size_t stackSize )                                               { this{ "Anonymous Thread", *mainCluster, NULL, stackSize }; }
+static inline void ?{}(thread_desc & this)                                                                  { this{ "Anonymous Thread", *mainCluster, 0p, 65000 }; }
+static inline void ?{}(thread_desc & this, size_t stackSize )                                               { this{ "Anonymous Thread", *mainCluster, 0p, stackSize }; }
 static inline void ?{}(thread_desc & this, void * storage, size_t storageSize )                             { this{ "Anonymous Thread", *mainCluster, storage, storageSize }; }
-static inline void ?{}(thread_desc & this, struct cluster & cl )                                            { this{ "Anonymous Thread", cl, NULL, 65000 }; }
-static inline void ?{}(thread_desc & this, struct cluster & cl, size_t stackSize )                          { this{ "Anonymous Thread", cl, NULL, stackSize }; }
+static inline void ?{}(thread_desc & this, struct cluster & cl )                                            { this{ "Anonymous Thread", cl, 0p, 65000 }; }
+static inline void ?{}(thread_desc & this, struct cluster & cl, size_t stackSize )                          { this{ "Anonymous Thread", cl, 0p, stackSize }; }
 static inline void ?{}(thread_desc & this, struct cluster & cl, void * storage, size_t storageSize )        { this{ "Anonymous Thread", cl, storage, storageSize }; }
-static inline void ?{}(thread_desc & this, const char * const name)                                         { this{ name, *mainCluster, NULL, 65000 }; }
-static inline void ?{}(thread_desc & this, const char * const name, struct cluster & cl )                   { this{ name, cl, NULL, 65000 }; }
-static inline void ?{}(thread_desc & this, const char * const name, struct cluster & cl, size_t stackSize ) { this{ name, cl, NULL, stackSize }; }
+static inline void ?{}(thread_desc & this, const char * const name)                                         { this{ name, *mainCluster, 0p, 65000 }; }
+static inline void ?{}(thread_desc & this, const char * const name, struct cluster & cl )                   { this{ name, cl, 0p, 65000 }; }
+static inline void ?{}(thread_desc & this, const char * const name, struct cluster & cl, size_t stackSize ) { this{ name, cl, 0p, stackSize }; }
 
 //-----------------------------------------------------------------------------
Index: libcfa/src/heap.cfa
===================================================================
--- libcfa/src/heap.cfa	(revision ee0bfa98a0c20dc13ba31575bd53582180239cf4)
+++ libcfa/src/heap.cfa	(revision fa35958abc0942e783f01f10de4587d2e962815b)
@@ -10,6 +10,6 @@
 // Created On       : Tue Dec 19 21:58:35 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Nov 29 17:33:58 2019
-// Update Count     : 641
+// Last Modified On : Tue Dec  3 13:58:44 2019
+// Update Count     : 642
 //
 
@@ -855,5 +855,6 @@
 		#endif // __STATISTICS__
 
-	  if ( unlikely( size == 0 ) ) { free( oaddr ); return 0p; } // special cases
+		// If size is equal to 0, either NULL or a pointer suitable to be passed to free() is returned.
+	  if ( unlikely( size == 0 ) ) { free( oaddr ); return mallocNoStats( size ); } // special cases
 	  if ( unlikely( oaddr == 0p ) ) return mallocNoStats( size );
 
@@ -1082,5 +1083,6 @@
 	#endif // __STATISTICS__
 
-  if ( unlikely( size == 0 ) ) { free( oaddr ); return 0p; } // special cases
+	// If size is equal to 0, either NULL or a pointer suitable to be passed to free() is returned.
+  if ( unlikely( size == 0 ) ) { free( oaddr ); return mallocNoStats( size ); } // special cases
   if ( unlikely( oaddr == 0p ) ) return mallocNoStats( size );
 
