Index: src/libcfa/stdlib
===================================================================
--- src/libcfa/stdlib	(revision afd550c52f430d2e5d349e8b8fac16a377f429da)
+++ src/libcfa/stdlib	(revision 74b19fb2413defce4fdf1fbccc3c804b14cbc0ac)
@@ -10,11 +10,11 @@
 // Created On       : Thu Jan 28 17:12:35 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Jan  2 12:21:04 2018
-// Update Count     : 292
+// Last Modified On : Sun May 13 23:22:23 2018
+// Update Count     : 299
 //
 
 #pragma once
 
-//#define _XOPEN_SOURCE 600								// posix_memalign, *rand48
+#define __USE_ISOC11									// aligned_alloc
 #include <stdlib.h>										// strto*, *abs
 
@@ -28,73 +28,78 @@
 //---------------------------------------
 
-// allocation, non-array types
-static inline forall( dtype T | sized(T) ) T * malloc( void ) {
-	// printf( "* malloc\n" );
-	return (T *)(void *)malloc( (size_t)sizeof(T) );	// C malloc
-} // malloc
-
-// static inline forall( dtype T | sized(T) ) T & malloc( void ) {
-// 	int & p = *(T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc
-// 	printf( "& malloc %p\n", &p );
-// 	return p;
-// //	return (T &)*(T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc
-// } // malloc
-
-extern "C" { void * calloc( size_t dim, size_t size ); } // default C routine
-static inline forall( dtype T | sized(T) ) T * calloc( size_t dim ) {
-	//printf( "X2\n" );
-	return (T *)(void *)calloc( dim, sizeof(T) );		// C cmalloc
-}
-
-extern "C" { void * realloc( void * ptr, size_t size ); } // default C routine for void *
-static inline forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size ) {
-	//printf( "X3\n" );
-	return (T *)(void *)realloc( (void *)ptr, size );
-}
-
-extern "C" { void * memalign( size_t align, size_t size ); } // use default C routine for void *
-static inline forall( dtype T | sized(T) ) T * memalign( size_t align ) {
-	//printf( "X4\n" );
-	return (T *)memalign( align, sizeof(T) );
-} // memalign
-
-static inline forall( dtype T | sized(T) ) T * aligned_alloc( size_t align ) {
-	//printf( "X5\n" );
-	return (T *)memalign( align, sizeof(T) );
-} // aligned_alloc
-
-extern "C" { int posix_memalign( void ** ptr, size_t align, size_t size ); } // use default C routine for void *
-static inline forall( dtype T | sized(T) ) int posix_memalign( T ** ptr, size_t align ) {
-	//printf( "X6\n" );
-	return posix_memalign( (void **)ptr, align, sizeof(T) );
-} // posix_memalign
-
-
-extern "C" { void * memset( void * dest, int c, size_t size ); } // use default C routine for void *
-
-static inline forall( dtype T | sized(T) ) T * alloc( void ) {
-	//printf( "X7\n" );
-	return (T *)(void *)malloc( (size_t)sizeof(T) );	// C malloc
-} // alloc
-static inline forall( dtype T | sized(T) ) T * alloc( char fill ) {
-	//printf( "X8\n" );
-	T * ptr = (T *)(void *)malloc( (size_t)sizeof(T) );	// C malloc
-    return (T *)memset( ptr, (int)fill, sizeof(T) );	// initial with fill value
-} // alloc
-
-static inline forall( dtype T | sized(T) ) T * alloc( size_t dim ) {
-	//printf( "X9\n" );
-	return (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C malloc
-} // alloc
-static inline forall( dtype T | sized(T) ) T * alloc( size_t dim, char fill ) {
-	//printf( "X10\n" );
-	T * ptr = (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C malloc
-    return (T *)memset( ptr, (int)fill, dim * sizeof(T) );
-} // alloc
-
-static inline forall( dtype T | sized(T) ) T * alloc( T ptr[], size_t dim ) {
-	//printf( "X11\n" );
-	return (T *)(void *)realloc( (void *)ptr, dim * (size_t)sizeof(T) ); // C realloc
-} // alloc
+// C dynamic allocation
+static inline forall( dtype T | sized(T) ) {
+	T * malloc( void ) {
+		// printf( "* malloc\n" );
+		return (T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc
+	} // malloc
+
+	// T & malloc( void ) {
+	// 	int & p = *(T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc
+	// 	printf( "& malloc %p\n", &p );
+	// 	return p;
+	// 	//	return (T &)*(T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc
+	// } // malloc
+
+	T * calloc( size_t dim ) {
+		//printf( "X2\n" );
+		return (T *)(void *)calloc( dim, sizeof(T) );	// C calloc
+	} // calloc
+
+	T * realloc( T * ptr, size_t size ) {
+		//printf( "X3\n" );
+		return (T *)(void *)realloc( (void *)ptr, size );
+	} // realloc
+
+	extern "C" { void * memalign( size_t align, size_t size ); } // use default C routine for void *
+	T * memalign( size_t align ) {
+		//printf( "X4\n" );
+		return (T *)memalign( align, sizeof(T) );
+	} // memalign
+
+	extern "C" { void * aligned_alloc( size_t align, size_t size ); } // use default C routine for void *
+	T * aligned_alloc( size_t align ) {
+		//printf( "X5\n" );
+		return (T *)aligned_alloc( align, sizeof(T) );
+	} // aligned_alloc
+
+	int posix_memalign( T ** ptr, size_t align ) {
+		//printf( "X6\n" );
+		return posix_memalign( (void **)ptr, align, sizeof(T) ); // C posix_memalign
+	} // posix_memalign
+
+
+	// Cforall dynamic allocation
+	extern "C" { void * memset( void * dest, int c, size_t size ); } // use default C routine for void *
+
+	T * alloc( void ) {
+		//printf( "X7\n" );
+		return (T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc
+	} // alloc
+
+	T * alloc( char fill ) {
+		//printf( "X8\n" );
+		T * ptr = (T *)(void *)malloc( (size_t)sizeof(T) );	// C malloc
+		return (T *)memset( ptr, (int)fill, sizeof(T) );	// initial with fill value
+	} // alloc
+
+	T * alloc( size_t dim ) {
+		//printf( "X9\n" );
+		return (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C malloc
+	} // alloc
+
+	T * alloc( size_t dim, char fill ) {
+		//printf( "X10\n" );
+		T * ptr = (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C malloc
+		return (T *)memset( ptr, (int)fill, dim * sizeof(T) );	  // initial with fill value
+	} // alloc
+
+	T * alloc( T ptr[], size_t dim ) {
+		//printf( "X11\n" );
+		return (T *)(void *)realloc( (void *)ptr, dim * (size_t)sizeof(T) ); // C realloc
+	} // alloc
+} // distribution
+
+
 forall( dtype T | sized(T) ) T * alloc( T ptr[], size_t dim, char fill );
 
