Index: libcfa/src/heap.cfa
===================================================================
--- libcfa/src/heap.cfa	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ libcfa/src/heap.cfa	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
@@ -10,6 +10,6 @@
 // Created On       : Tue Dec 19 21:58:35 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu May  9 16:29:12 2019
-// Update Count     : 516
+// Last Modified On : Tue Jul 23 14:13:13 2019
+// Update Count     : 549
 //
 
@@ -31,50 +31,4 @@
 
 
-enum {
-	__CFA_DEFAULT_MMAP_START__ = (512 * 1024 + 1),
-	__CFA_DEFAULT_HEAP_EXPANSION__ = (1 * 1024 * 1024),
-};
-
-size_t default_mmap_start() __attribute__(( weak )) {
-	return __CFA_DEFAULT_MMAP_START__;
-} // default_mmap_start
-
-size_t default_heap_expansion() __attribute__(( weak )) {
-	return __CFA_DEFAULT_HEAP_EXPANSION__;
-} // default_heap_expansion
-
-
-// supported mallopt options
-#ifndef M_MMAP_THRESHOLD
-#define M_MMAP_THRESHOLD (-1)
-#endif // M_TOP_PAD
-#ifndef M_TOP_PAD
-#define M_TOP_PAD (-2)
-#endif // M_TOP_PAD
-
-#define FASTLOOKUP
-#define __STATISTICS__
-
-#define SPINLOCK 0
-#define LOCKFREE 1
-#define BUCKETLOCK SPINLOCK
-#if BUCKETLOCK == LOCKFREE
-#include <uStackLF.h>
-#endif // LOCKFREE
-
-// #comment TD : This defined is significantly different from the __ALIGN__ define from locks.hfa
-#define ALIGN 16
-
-// enum { NoBucketSizes = 93,								// number of buckets sizes
-// #ifdef FASTLOOKUP
-// 	   LookupSizes = 65536,								// number of fast lookup sizes
-// #endif // FASTLOOKUP
-// };
-#define NoBucketSizes 93								// number of buckets sizes
-#ifdef FASTLOOKUP
-#define LookupSizes 65536								// number of fast lookup sizes
-#endif // FASTLOOKUP
-
-
 static bool traceHeap = false;
 
@@ -132,4 +86,18 @@
 // 	return temp;
 // } // traceHeapTermOff
+
+
+enum {
+	__CFA_DEFAULT_MMAP_START__ = (512 * 1024 + 1),
+	__CFA_DEFAULT_HEAP_EXPANSION__ = (1 * 1024 * 1024),
+};
+
+size_t default_mmap_start() __attribute__(( weak )) {
+	return __CFA_DEFAULT_MMAP_START__;
+} // default_mmap_start
+
+size_t default_heap_expansion() __attribute__(( weak )) {
+	return __CFA_DEFAULT_HEAP_EXPANSION__;
+} // default_heap_expansion
 
 
@@ -160,4 +128,24 @@
 #endif // __CFA_DEBUG__
 
+// statically allocated variables => zero filled.
+static size_t pageSize;									// architecture pagesize
+static size_t heapExpand;								// sbrk advance
+static size_t mmapStart;								// cross over point for mmap
+static unsigned int maxBucketsUsed;						// maximum number of buckets in use
+
+
+// #comment TD : This defined is significantly different from the __ALIGN__ define from locks.hfa
+#define ALIGN 16
+
+#define SPINLOCK 0
+#define LOCKFREE 1
+#define BUCKETLOCK SPINLOCK
+#if BUCKETLOCK == LOCKFREE
+#include <uStackLF.h>
+#endif // LOCKFREE
+
+// Recursive definitions: HeapManager needs size of bucket array and bucket area needs sizeof HeapManager storage.
+// Break recusion by hardcoding number of buckets and statically checking number is correct after bucket array defined.
+enum { NoBucketSizes = 93 };							// number of buckets sizes
 
 struct HeapManager {
@@ -234,15 +222,12 @@
 }; // HeapManager
 
-
 static inline size_t getKey( const HeapManager.FreeHeader & freeheader ) { return freeheader.blockSize; }
 
-// statically allocated variables => zero filled.
-static size_t pageSize;									// architecture pagesize
-static size_t heapExpand;								// sbrk advance
-static size_t mmapStart;								// cross over point for mmap
-static unsigned int maxBucketsUsed;						// maximum number of buckets in use
+
+#define FASTLOOKUP
+#define __STATISTICS__
 
 // Powers of 2 are common allocation sizes, so make powers of 2 generate the minimum required size.
-static const unsigned int bucketSizes[NoBucketSizes] @= { // different bucket sizes
+static const unsigned int bucketSizes[] @= {			// different bucket sizes
 	16, 32, 48, 64,
 	64 + sizeof(HeapManager.Storage), 96, 112, 128, 128 + sizeof(HeapManager.Storage), 160, 192, 224,
@@ -259,5 +244,10 @@
 	4_194_304 + sizeof(HeapManager.Storage)
 };
+
+static_assert( NoBucketSizes == sizeof(bucketSizes) / sizeof(bucketSizes[0]), "size of bucket array wrong" );
+
 #ifdef FASTLOOKUP
+static_assert( 16 == sizeof(HeapManager.Storage), "size of HeapManager Storage wrong" ); // FIX ME
+enum { LookupSizes = 65_536 + 16 };						// number of fast lookup sizes
 static unsigned char lookup[LookupSizes];				// O(1) lookup for small sizes
 #endif // FASTLOOKUP
@@ -532,4 +522,18 @@
 
 
+size_t Bsearchl( unsigned int key, const unsigned int * vals, size_t dim ) {
+	size_t l = 0, m, h = dim;
+	while ( l < h ) {
+		m = (l + h) / 2;
+		if ( (unsigned int &)(vals[m]) < key ) {		// cast away const
+			l = m + 1;
+		} else {
+			h = m;
+		} // if
+	} // while
+	return l;
+} // Bsearchl
+
+
 static inline void * doMalloc( size_t size ) with ( heapManager ) {
 	HeapManager.Storage * block;						// pointer to new block of storage
@@ -540,9 +544,22 @@
 	size_t tsize = size + sizeof(HeapManager.Storage);
 	if ( likely( tsize < mmapStart ) ) {				// small size => sbrk
-		HeapManager.FreeHeader * freeElem =
-			#ifdef FASTLOOKUP
-			tsize < LookupSizes ? &freeLists[lookup[tsize]] :
-			#endif // FASTLOOKUP
-			bsearchl( tsize, freeLists, (size_t)maxBucketsUsed ); // binary search
+		size_t posn;
+		#ifdef FASTLOOKUP
+		if ( tsize < LookupSizes ) posn = lookup[tsize];
+		else
+		#endif // FASTLOOKUP
+			posn = Bsearchl( (unsigned int)tsize, bucketSizes, (size_t)maxBucketsUsed );
+		HeapManager.FreeHeader * freeElem = &freeLists[posn];
+		// #ifdef FASTLOOKUP
+		// if ( tsize < LookupSizes )
+		// 	freeElem = &freeLists[lookup[tsize]];
+		// else
+		// #endif // FASTLOOKUP
+		//  	freeElem = bsearchl( tsize, freeLists, (size_t)maxBucketsUsed ); // binary search
+		// HeapManager.FreeHeader * freeElem =
+		// 	#ifdef FASTLOOKUP
+		// 	tsize < LookupSizes ? &freeLists[lookup[tsize]] :
+		// 	#endif // FASTLOOKUP
+		// 	bsearchl( tsize, freeLists, (size_t)maxBucketsUsed ); // binary search
 		assert( freeElem <= &freeLists[maxBucketsUsed] ); // subscripting error ?
 		assert( tsize <= freeElem->blockSize );			// search failure ?
@@ -747,4 +764,13 @@
 
 
+// supported mallopt options
+#ifndef M_MMAP_THRESHOLD
+#define M_MMAP_THRESHOLD (-1)
+#endif // M_TOP_PAD
+#ifndef M_TOP_PAD
+#define M_TOP_PAD (-2)
+#endif // M_TOP_PAD
+
+
 extern "C" {
 	// The malloc() function allocates size bytes and returns a pointer to the allocated memory. The memory is not
@@ -843,5 +869,5 @@
 		void * area;
 		if ( unlikely( alignment != 0 ) ) {				// previous request memalign?
-			area = memalign( alignment, size );			// create new area
+			area = memalign( alignment, size );			// create new aligned area
 		} else {
 			area = mallocNoStats( size );				// create new area
Index: libcfa/src/stdlib.hfa
===================================================================
--- libcfa/src/stdlib.hfa	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ libcfa/src/stdlib.hfa	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
@@ -10,6 +10,6 @@
 // Created On       : Thu Jan 28 17:12:35 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Apr 24 17:35:43 2019
-// Update Count     : 352
+// Last Modified On : Tue Jul 23 14:14:59 2019
+// Update Count     : 373
 //
 
@@ -17,6 +17,8 @@
 
 #include "bits/defs.hfa"
+#include "bits/align.hfa"
 
 #include <stdlib.h>										// *alloc, strto*, ato*
+
 extern "C" {
 	void * memalign( size_t align, size_t size );		// malloc.h
@@ -39,12 +41,15 @@
 
 	T * malloc( void ) {
-		return (T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc
+		if ( _Alignof(T) <= libAlign() ) return (T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc
+		else return (T *)memalign( _Alignof(T), sizeof(T) );
 	} // malloc
 
 	T * calloc( size_t dim ) {
-		return (T *)(void *)calloc( dim, sizeof(T) );	// C calloc
+		if ( _Alignof(T) <= libAlign() )return (T *)(void *)calloc( dim, sizeof(T) ); // C calloc
+		else return (T *)cmemalign( _Alignof(T), dim, sizeof(T) );
 	} // calloc
 
 	T * realloc( T * ptr, size_t size ) {
+		if ( unlikely( ptr == 0 ) ) return malloc();
 		return (T *)(void *)realloc( (void *)ptr, size );
 	} // realloc
@@ -66,28 +71,27 @@
 
 	T * alloc( void ) {
-		return (T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc
+		return malloc();
 	} // alloc
 
 	T * alloc( char fill ) {
-		T * ptr = (T *)(void *)malloc( (size_t)sizeof(T) );	// C malloc
+		T * ptr;
+		if ( _Alignof(T) <= libAlign() ) ptr = (T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc
+		else ptr = (T *)memalign( _Alignof(T), sizeof(T) );
 		return (T *)memset( ptr, (int)fill, sizeof(T) ); // initialize with fill value
 	} // alloc
 
 	T * alloc( size_t dim ) {
-		return (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C malloc
+		if ( _Alignof(T) <= libAlign() ) return (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C malloc
+		else return (T *)memalign( _Alignof(T), dim * sizeof(T) );
 	} // alloc
 
 	T * alloc( size_t dim, char fill ) {
-		T * ptr = (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C calloc
-		return (T *)memset( ptr, (int)fill, dim * sizeof(T) ); // initialize with fill value
+		return (T *)memset( (T *)alloc( dim ), (int)fill, dim * sizeof(T) ); // initialize with fill value
 	} // alloc
 
 	T * alloc( T ptr[], size_t dim ) {
-		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 );
+		return realloc( ptr, dim * sizeof(T) );
+	} // alloc
+} // distribution
 
 
@@ -107,14 +111,13 @@
 
 	T * align_alloc( size_t align, size_t dim, char fill ) {
-		T * ptr;
 		if ( fill == '\0' ) {
-			ptr = (T *)cmemalign( align, dim, sizeof(T) );
+			return (T *)cmemalign( align, dim, sizeof(T) );
 		} else {
-			ptr = (T *)memalign( align, dim * sizeof(T) );
-			return (T *)memset( ptr, (int)fill, dim * sizeof(T) );
+			return (T *)memset( (T *)memalign( align, dim * sizeof(T) ), (int)fill, dim * sizeof(T) );
 		} // if
-		return ptr;
-	} // align_alloc
-} // distribution
+	} // align_alloc
+} // distribution
+
+forall( dtype T | sized(T) ) T * alloc( T ptr[], size_t dim, char fill );
 
 
Index: src/InitTweak/InitTweak.cc
===================================================================
--- src/InitTweak/InitTweak.cc	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ src/InitTweak/InitTweak.cc	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
@@ -9,7 +9,7 @@
 // Author           : Rob Schluntz
 // Created On       : Fri May 13 11:26:36 2016
-// Last Modified By : Aaron B. Moss
-// Last Modified On : Mon Jun 10 13:30:00 2019
-// Update Count     : 5
+// Last Modified By : Andrew Beach
+// Last Modified On : Fri Jun 19 14:34:00 2019
+// Update Count     : 6
 //
 
@@ -633,13 +633,21 @@
 			return nullptr;
 		}
+
+		DeclarationWithType * getFunctionCore( const Expression * expr ) {
+			if ( const auto * appExpr = dynamic_cast< const ApplicationExpr * >( expr ) ) {
+				return getCalledFunction( appExpr->function );
+			} else if ( const auto * untyped = dynamic_cast< const UntypedExpr * >( expr ) ) {
+				return getCalledFunction( untyped->function );
+			}
+			assertf( false, "getFunction with unknown expression: %s", toString( expr ).c_str() );
+		}
 	}
 
 	DeclarationWithType * getFunction( Expression * expr ) {
-		if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr ) ) {
-			return getCalledFunction( appExpr->get_function() );
-		} else if ( UntypedExpr * untyped = dynamic_cast< UntypedExpr * > ( expr ) ) {
-			return getCalledFunction( untyped->get_function() );
-		}
-		assertf( false, "getFunction received unknown expression: %s", toString( expr ).c_str() );
+		return getFunctionCore( expr );
+	}
+
+	const DeclarationWithType * getFunction( const Expression * expr ) {
+		return getFunctionCore( expr );
 	}
 
Index: src/InitTweak/InitTweak.h
===================================================================
--- src/InitTweak/InitTweak.h	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ src/InitTweak/InitTweak.h	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
@@ -9,7 +9,7 @@
 // Author           : Rob Schluntz
 // Created On       : Fri May 13 11:26:36 2016
-// Last Modified By : Aaron B. Moss
-// Last Modified On : Mon Jun 10 13:30:00 2019
-// Update Count     : 5
+// Last Modified By : Andrew Beach
+// Last Modified On : Fri Jul 19 14:18:00 2019
+// Update Count     : 6
 //
 
@@ -61,4 +61,5 @@
 	/// returns the declaration of the function called by the expr (must be ApplicationExpr or UntypedExpr)
 	DeclarationWithType * getFunction( Expression * expr );
+	const DeclarationWithType * getFunction( const Expression * expr );
 	const ast::DeclWithType * getFunction( const ast::Expr * expr );
 
Index: src/ResolvExpr/Alternative.h
===================================================================
--- src/ResolvExpr/Alternative.h	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ src/ResolvExpr/Alternative.h	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
@@ -29,9 +29,9 @@
 	/// One assertion to resolve
 	struct AssertionItem {
-		DeclarationWithType* decl;
+		const DeclarationWithType* decl;
 		AssertionSetValue info;
-		
+
 		AssertionItem() = default;
-		AssertionItem( DeclarationWithType* decl, const AssertionSetValue& info ) 
+		AssertionItem( const DeclarationWithType* decl, const AssertionSetValue& info )
 		: decl(decl), info(info) {}
 		AssertionItem( const AssertionSet::value_type& e ) : decl(e.first), info(e.second) {}
Index: src/ResolvExpr/FindOpenVars.cc
===================================================================
--- src/ResolvExpr/FindOpenVars.cc	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ src/ResolvExpr/FindOpenVars.cc	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Sun May 17 09:42:48 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Sun May 17 09:45:25 2015
-// Update Count     : 3
+// Last Modified By : Andrew
+// Last Modified On : Fri Jul 12 14:18:00 2019
+// Update Count     : 4
 //
 
@@ -29,10 +29,10 @@
 		FindOpenVars_old( OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen );
 
-		void previsit( PointerType * pointerType );
-		void previsit( ArrayType * arrayType );
-		void previsit( FunctionType * functionType );
-		void previsit( TupleType * tupleType );
+		void previsit( const PointerType * pointerType );
+		void previsit( const ArrayType * arrayType );
+		void previsit( const FunctionType * functionType );
+		void previsit( const TupleType * tupleType );
 
-		void common_action( Type *type );
+		void common_action( const Type *type );
 
 		OpenVarSet &openVars, &closedVars;
@@ -41,5 +41,5 @@
 	};
 
-	void findOpenVars( Type *type, OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen ) {
+	void findOpenVars( const Type *type, OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen ) {
 		PassVisitor<FindOpenVars_old> finder( openVars, closedVars, needAssertions, haveAssertions, firstIsOpen );
 		type->accept( finder );
@@ -50,7 +50,7 @@
 	}
 
-	void FindOpenVars_old::common_action( Type *type ) {
+	void FindOpenVars_old::common_action( const Type * type ) {
 		if ( nextIsOpen ) {
-			for ( Type::ForallList::const_iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) {
+			for ( Type::ForallList::const_iterator i = type->forall.begin(); i != type->forall.end(); ++i ) {
 				openVars[ (*i)->get_name() ] = TypeDecl::Data{ (*i) };
 				for ( std::list< DeclarationWithType* >::const_iterator assert = (*i)->get_assertions().begin(); assert != (*i)->get_assertions().end(); ++assert ) {
@@ -61,5 +61,5 @@
 			}
 		} else {
-			for ( Type::ForallList::const_iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) {
+			for ( Type::ForallList::const_iterator i = type->forall.begin(); i != type->forall.end(); ++i ) {
 				closedVars[ (*i)->get_name() ] = TypeDecl::Data{ (*i) };
 				for ( std::list< DeclarationWithType* >::const_iterator assert = (*i)->get_assertions().begin(); assert != (*i)->get_assertions().end(); ++assert ) {
@@ -78,13 +78,13 @@
 	}
 
-	void FindOpenVars_old::previsit(PointerType *pointerType) {
+	void FindOpenVars_old::previsit(const PointerType * pointerType) {
 		common_action( pointerType );
 	}
 
-	void FindOpenVars_old::previsit(ArrayType *arrayType) {
+	void FindOpenVars_old::previsit(const ArrayType * arrayType) {
 		common_action( arrayType );
 	}
 
-	void FindOpenVars_old::previsit(FunctionType *functionType) {
+	void FindOpenVars_old::previsit(const FunctionType * functionType) {
 		common_action( functionType );
 		nextIsOpen = ! nextIsOpen;
@@ -92,5 +92,5 @@
 	}
 
-	void FindOpenVars_old::previsit(TupleType *tupleType) {
+	void FindOpenVars_old::previsit(const TupleType * tupleType) {
 		common_action( tupleType );
 	}
@@ -104,6 +104,6 @@
 			bool nextIsOpen;
 
-			FindOpenVars_new( 
-				ast::OpenVarSet & o, ast::OpenVarSet & c, ast::AssertionSet & n, 
+			FindOpenVars_new(
+				ast::OpenVarSet & o, ast::OpenVarSet & c, ast::AssertionSet & n,
 				ast::AssertionSet & h, FirstMode firstIsOpen )
 			: open( o ), closed( c ), need( n ), have( h ), nextIsOpen( firstIsOpen ) {}
@@ -135,6 +135,6 @@
 	}
 
-	void findOpenVars( 
-			const ast::Type * type, ast::OpenVarSet & open, ast::OpenVarSet & closed, 
+	void findOpenVars(
+			const ast::Type * type, ast::OpenVarSet & open, ast::OpenVarSet & closed,
 			ast::AssertionSet & need, ast::AssertionSet & have, FirstMode firstIsOpen ) {
 		ast::Pass< FindOpenVars_new > finder{ open, closed, need, have, firstIsOpen };
Index: src/ResolvExpr/FindOpenVars.h
===================================================================
--- src/ResolvExpr/FindOpenVars.h	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ src/ResolvExpr/FindOpenVars.h	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
@@ -26,5 +26,5 @@
 namespace ResolvExpr {
 	// Updates open and closed variables and their associated assertions
-	void findOpenVars( Type *type, OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen );
+	void findOpenVars( const Type *type, OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen );
 
 	enum FirstMode { FirstClosed, FirstOpen };
Index: src/ResolvExpr/Occurs.cc
===================================================================
--- src/ResolvExpr/Occurs.cc	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ src/ResolvExpr/Occurs.cc	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
@@ -24,5 +24,5 @@
 	struct Occurs : public WithVisitorRef<Occurs> {
 		Occurs( std::string varName, const TypeEnvironment &env );
-		void previsit( TypeInstType * typeInst );
+		void previsit( const TypeInstType * typeInst );
 
 		bool result;
@@ -31,5 +31,5 @@
 	};
 
-	bool occurs( Type *type, std::string varName, const TypeEnvironment &env ) {
+	bool occurs( const Type *type, const std::string & varName, const TypeEnvironment &env ) {
 		PassVisitor<Occurs> occur( varName, env );
 		type->accept( occur );
@@ -45,5 +45,5 @@
 	}
 
-	void Occurs::previsit( TypeInstType * typeInst ) {
+	void Occurs::previsit( const TypeInstType * typeInst ) {
 		///   std::cerr << "searching for vars: ";
 ///   std::copy( eqvVars.begin(), eqvVars.end(), std::ostream_iterator< std::string >( std::cerr, " " ) );
Index: src/ResolvExpr/ResolveAssertions.cc
===================================================================
--- src/ResolvExpr/ResolveAssertions.cc	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ src/ResolvExpr/ResolveAssertions.cc	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
@@ -73,5 +73,5 @@
 		CandidateList matches;
 
-		DeferItem( DeclarationWithType* decl, const AssertionSetValue& info, CandidateList&& matches )
+		DeferItem( const DeclarationWithType* decl, const AssertionSetValue& info, CandidateList&& matches )
 		: decl(decl), info(info), matches(std::move(matches)) {}
 
Index: src/ResolvExpr/TypeEnvironment.cc
===================================================================
--- src/ResolvExpr/TypeEnvironment.cc	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ src/ResolvExpr/TypeEnvironment.cc	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Sun May 17 12:19:47 2015
-// Last Modified By : Aaron B. Moss
-// Last Modified On : Mon Jun 18 11:58:00 2018
-// Update Count     : 4
+// Last Modified By : Andrew Beach
+// Last Modified On : Fri Jun 18 14:27:00 2019
+// Update Count     : 5
 //
 
@@ -315,8 +315,8 @@
 	}
 
-	bool isFtype( Type *type ) {
-		if ( dynamic_cast< FunctionType* >( type ) ) {
+	bool isFtype( const Type * type ) {
+		if ( dynamic_cast< const FunctionType * >( type ) ) {
 			return true;
-		} else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( type ) ) {
+		} else if ( const TypeInstType *typeInst = dynamic_cast< const TypeInstType * >( type ) ) {
 			return typeInst->get_isFtype();
 		} // if
@@ -324,5 +324,5 @@
 	}
 
-	bool tyVarCompatible( const TypeDecl::Data & data, Type *type ) {
+	bool tyVarCompatible( const TypeDecl::Data & data, const Type * type ) {
 		switch ( data.kind ) {
 		  case TypeDecl::Dtype:
@@ -336,5 +336,5 @@
 		  case TypeDecl::Ttype:
 			// ttype unifies with any tuple type
-			return dynamic_cast< TupleType * >( type ) || Tuples::isTtype( type );
+			return dynamic_cast< const TupleType * >( type ) || Tuples::isTtype( type );
 		  default:
 			assertf(false, "Unhandled tyvar kind: %d", data.kind);
@@ -343,5 +343,5 @@
 	}
 
-	bool TypeEnvironment::bindVar( TypeInstType *typeInst, Type *bindTo, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer ) {
+	bool TypeEnvironment::bindVar( const TypeInstType *typeInst, Type *bindTo, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer ) {
 
 		// remove references from other, so that type variables can only bind to value types
@@ -361,5 +361,5 @@
 				// attempt to unify equivalence class type (which has qualifiers stripped, so they must be restored) with the type to bind to
 				std::unique_ptr< Type > newType( curClass->type->clone() );
-				newType->get_qualifiers() = typeInst->get_qualifiers();
+				newType->tq = typeInst->tq;
 				if ( unifyInexact( newType.get(), bindTo, *this, need, have, openVars, widen & WidenMode( curClass->allowWidening, true ), indexer, common ) ) {
 					if ( common ) {
@@ -386,6 +386,6 @@
 	}
 
-	bool TypeEnvironment::bindVarToVar( TypeInstType *var1, TypeInstType *var2, 
-			TypeDecl::Data && data, AssertionSet &need, AssertionSet &have, 
+	bool TypeEnvironment::bindVarToVar( const TypeInstType * var1, const TypeInstType * var2,
+			TypeDecl::Data && data, AssertionSet &need, AssertionSet &have,
 			const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer ) {
 
Index: src/ResolvExpr/TypeEnvironment.h
===================================================================
--- src/ResolvExpr/TypeEnvironment.h	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ src/ResolvExpr/TypeEnvironment.h	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Sun May 17 12:24:58 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Apr 30 23:04:10 2019
-// Update Count     : 9
+// Last Modified By : Andrew Beach
+// Last Modified On : Fri Jul 19 17:00:10 2019
+// Update Count     : 10
 //
 
@@ -40,5 +40,5 @@
 	// declarations.
 	//
-	// I've seen a TU go from 54 minutes to 1 minute 34 seconds with the addition of this 
+	// I've seen a TU go from 54 minutes to 1 minute 34 seconds with the addition of this
 	// comparator.
 	//
@@ -46,12 +46,12 @@
 	// memory layout can alter compilation time in unpredictable ways. For example, the placement
 	// of a line directive can reorder type pointers with respect to each other so that assertions
-	// are seen in different orders, causing a potentially different number of unification calls 
-	// when resolving assertions. I've seen a TU go from 36 seconds to 27 seconds by reordering 
-	// line directives alone, so it would be nice to fix this comparison so that assertions compare 
-	// more consistently. I've tried to modify this to compare on mangle name instead of type as 
-	// the second comparator, but this causes some assertions to never be recorded. More 
+	// are seen in different orders, causing a potentially different number of unification calls
+	// when resolving assertions. I've seen a TU go from 36 seconds to 27 seconds by reordering
+	// line directives alone, so it would be nice to fix this comparison so that assertions compare
+	// more consistently. I've tried to modify this to compare on mangle name instead of type as
+	// the second comparator, but this causes some assertions to never be recorded. More
 	// investigation is needed.
 	struct AssertCompare {
-		bool operator()( DeclarationWithType * d1, DeclarationWithType * d2 ) const {
+		bool operator()( const DeclarationWithType * d1, const DeclarationWithType * d2 ) const {
 			int cmp = d1->get_name().compare( d2->get_name() );
 			return cmp < 0 ||
@@ -65,5 +65,5 @@
 		AssertionSetValue() : isUsed(false), resnSlot(0) {}
 	};
-	typedef std::map< DeclarationWithType *, AssertionSetValue, AssertCompare > AssertionSet;
+	typedef std::map< const DeclarationWithType *, AssertionSetValue, AssertCompare > AssertionSet;
 	typedef std::unordered_map< std::string, TypeDecl::Data > OpenVarSet;
 
@@ -78,5 +78,5 @@
 	struct EqvClass {
 		std::set< std::string > vars;
-		Type *type;
+		Type * type;
 		bool allowWidening;
 		TypeDecl::Data data;
@@ -111,5 +111,5 @@
 		bool isEmpty() const { return env.empty(); }
 		void print( std::ostream &os, Indenter indent = {} ) const;
-		
+
 		/// Simply concatenate the second environment onto this one; no safety checks performed
 		void simpleCombine( const TypeEnvironment &second );
@@ -126,5 +126,5 @@
 		/// Returns false if fails, but does NOT roll back partial changes.
 		bool combine( const TypeEnvironment& second, OpenVarSet& openVars, const SymTab::Indexer& indexer );
-		
+
 		void extractOpenVars( OpenVarSet &openVars ) const;
 		TypeEnvironment *clone() const { return new TypeEnvironment( *this ); }
@@ -134,11 +134,11 @@
 		void addActual( const TypeEnvironment& actualEnv, OpenVarSet& openVars );
 
-		/// Binds the type class represented by `typeInst` to the type `bindTo`; will add 
+		/// Binds the type class represented by `typeInst` to the type `bindTo`; will add
 		/// the class if needed. Returns false on failure.
-		bool bindVar( TypeInstType *typeInst, Type *bindTo, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer );
-		
-		/// Binds the type classes represented by `var1` and `var2` together; will add 
+		bool bindVar( const TypeInstType * typeInst, Type * bindTo, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer );
+
+		/// Binds the type classes represented by `var1` and `var2` together; will add
 		/// one or both classes if needed. Returns false on failure.
-		bool bindVarToVar( TypeInstType *var1, TypeInstType *var2, TypeDecl::Data && data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer );
+		bool bindVarToVar( const TypeInstType * var1, const TypeInstType * var2, TypeDecl::Data && data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer );
 
 		/// Disallows widening for all bindings in the environment
@@ -151,5 +151,5 @@
 	  private:
 		ClassList env;
-		
+
 		ClassList::iterator internal_lookup( const std::string &var );
 	};
Index: src/ResolvExpr/typeops.h
===================================================================
--- src/ResolvExpr/typeops.h	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ src/ResolvExpr/typeops.h	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
@@ -149,5 +149,5 @@
 
 	// in Occurs.cc
-	bool occurs( Type * type, std::string varName, const TypeEnvironment & env );
+	bool occurs( const Type * type, const std::string & varName, const TypeEnvironment & env );
 	// new AST version in TypeEnvironment.cpp (only place it was used in old AST)
 
@@ -200,5 +200,5 @@
 
 	// in TypeEnvironment.cc
-	bool isFtype( Type * type );
+	bool isFtype( const Type * type );
 } // namespace ResolvExpr
 
Index: src/SynTree/Type.cc
===================================================================
--- src/SynTree/Type.cc	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ src/SynTree/Type.cc	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Jan 31 21:54:16 2019
-// Update Count     : 43
+// Last Modified By : Andrew Beach
+// Last Modified On : Fri Jul 12 15:48:00 2019
+// Update Count     : 44
 //
 #include "Type.h"
@@ -141,4 +141,11 @@
 }
 
+const Type * Type::stripReferences() const {
+	const Type * type;
+	const ReferenceType * ref;
+	for ( type = this; (ref = dynamic_cast<const ReferenceType *>( type )); type = ref->base );
+	return type;
+}
+
 int Type::referenceDepth() const { return 0; }
 
Index: src/SynTree/Type.h
===================================================================
--- src/SynTree/Type.h	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ src/SynTree/Type.h	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
@@ -172,4 +172,5 @@
 	/// return type without outer references
 	Type * stripReferences();
+	const Type * stripReferences() const;
 
 	/// return the number of references occuring consecutively on the outermost layer of this type (i.e. do not count references nested within other types)
@@ -256,5 +257,5 @@
 	BasicType( const Type::Qualifiers & tq, Kind bt, const std::list< Attribute * > & attributes = std::list< Attribute * >() );
 
-	Kind get_kind() { return kind; }
+	Kind get_kind() const { return kind; }
 	void set_kind( Kind newValue ) { kind = newValue; }
 
Index: src/SynTree/module.mk
===================================================================
--- src/SynTree/module.mk	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ src/SynTree/module.mk	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
Index: src/Tuples/TupleExpansion.cc
===================================================================
--- src/Tuples/TupleExpansion.cc	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ src/Tuples/TupleExpansion.cc	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
@@ -9,7 +9,7 @@
 // Author           : Rodolfo G. Esteves
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Feb 13 18:14:12 2019
-// Update Count     : 21
+// Last Modified By : Andrew Beach
+// Last Modified On : Fri Jul 19 14:39:00 2019
+// Update Count     : 22
 //
 
@@ -350,4 +350,13 @@
 	}
 
+	const TypeInstType * isTtype( const Type * type ) {
+		if ( const TypeInstType * inst = dynamic_cast< const TypeInstType * >( type ) ) {
+			if ( inst->baseType && inst->baseType->kind == TypeDecl::Ttype ) {
+				return inst;
+			}
+		}
+		return nullptr;
+	}
+
 	const ast::TypeInstType * isTtype( const ast::Type * type ) {
 		if ( const ast::TypeInstType * inst = dynamic_cast< const ast::TypeInstType * >( type ) ) {
@@ -364,9 +373,9 @@
 			ImpurityDetector( bool ignoreUnique ) : ignoreUnique( ignoreUnique ) {}
 
-			void previsit( ApplicationExpr * appExpr ) {
+			void previsit( const ApplicationExpr * appExpr ) {
 				visit_children = false;
-				if ( DeclarationWithType * function = InitTweak::getFunction( appExpr ) ) {
-					if ( function->get_linkage() == LinkageSpec::Intrinsic ) {
-						if ( function->get_name() == "*?" || function->get_name() == "?[?]" ) {
+				if ( const DeclarationWithType * function = InitTweak::getFunction( appExpr ) ) {
+					if ( function->linkage == LinkageSpec::Intrinsic ) {
+						if ( function->name == "*?" || function->name == "?[?]" ) {
 							// intrinsic dereference, subscript are pure, but need to recursively look for impurity
 							visit_children = true;
@@ -377,6 +386,6 @@
 				maybeImpure = true;
 			}
-			void previsit( UntypedExpr * ) { maybeImpure = true; visit_children = false; }
-			void previsit( UniqueExpr * ) {
+			void previsit( const UntypedExpr * ) { maybeImpure = true; visit_children = false; }
+			void previsit( const UniqueExpr * ) {
 				if ( ignoreUnique ) {
 					// bottom out at unique expression.
@@ -393,5 +402,5 @@
 	} // namespace
 
-	bool maybeImpure( Expression * expr ) {
+	bool maybeImpure( const Expression * expr ) {
 		PassVisitor<ImpurityDetector> detector( false );
 		expr->accept( detector );
@@ -399,5 +408,5 @@
 	}
 
-	bool maybeImpureIgnoreUnique( Expression * expr ) {
+	bool maybeImpureIgnoreUnique( const Expression * expr ) {
 		PassVisitor<ImpurityDetector> detector( true );
 		expr->accept( detector );
Index: src/Tuples/Tuples.h
===================================================================
--- src/Tuples/Tuples.h	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ src/Tuples/Tuples.h	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
@@ -52,13 +52,14 @@
 	/// returns a TypeInstType if `type` is a ttype, nullptr otherwise
 	TypeInstType * isTtype( Type * type );
+	const TypeInstType * isTtype( const Type * type );
 	const ast::TypeInstType * isTtype( const ast::Type * type );
 
 	/// returns true if the expression may contain side-effects.
-	bool maybeImpure( Expression * expr );
+	bool maybeImpure( const Expression * expr );
 	bool maybeImpure( const ast::Expr * expr );
 
 	/// Returns true if the expression may contain side-effect,
 	/// ignoring the presence of unique expressions.
-	bool maybeImpureIgnoreUnique( Expression * expr );
+	bool maybeImpureIgnoreUnique( const Expression * expr );
 	bool maybeImpureIgnoreUnique( const ast::Expr * expr );
 } // namespace Tuples
Index: tests/.expect/copyfile.txt
===================================================================
--- tests/.expect/copyfile.txt	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ tests/.expect/copyfile.txt	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
@@ -10,36 +10,37 @@
 // Created On       : Tue Jul 16 16:47:22 2019
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Jul 16 16:48:16 2019
-// Update Count     : 1
+// Last Modified On : Wed Jul 17 18:04:44 2019
+// Update Count     : 26
 // 
 
 #include <fstream.hfa>
+#include <stdlib.hfa>									// new/delete
 
 int main( int argc, char * argv[] ) {
-    ifstream & in  = stdin;				// default files
-    ofstream & out = stdout;
-    try {
-	choose ( argc ) {
-	  case 2, 3:
-	    open( in, argv[1] );			// open input file first as output creates file
-	    if ( argc == 3 ) open( out, argv[2] );	// only open output if input opens as output created if nonexistent
-	  case 1: ;					// use default files
-	  default:
-	    exit | "Usage [ input-file (default stdin) [ output-file (default stdout) ] ]";
-	} // choose
+	ifstream * in  = &stdin;							// default files
+	ofstream * out = &stdout;
+	try {
+		choose ( argc ) {
+		  case 2, 3:
+			  in = new( (const char *)argv[1] );		// open input file first as output creates file
+			  if ( argc == 3 ) out = new( (const char *)argv[2] ); // only open output if input opens as output created if nonexistent
+		  case 1: ;					// use default files
+		  default:
+			  exit | "Usage [ input-file (default stdin) [ output-file (default stdout) ] ]";
+		} // choose
 
-	char ch;
-	out | nlOff;					// turn off auto newline
-	in  | nlOn;					// turn on reading newline
+		char ch;
+		*out | nlOff;									// turn off auto newline
+		*in  | nlOn;									// turn on reading newline
 
-	for () {					// read all characters
-	    in | ch;
-	  if ( eof( in ) ) break;			// eof ?
-	    out | ch;
-	} // for
-    } finally {
-	close( in );					// stdin, stdout are never closed
-	close( out );
-    } // try
+		for () {										// read all characters
+			*in | ch;
+		  if ( eof( *in ) ) break;						// eof ?
+			*out | ch;
+		} // for
+	} finally {
+		if ( in  != &stdin  ) delete( in );				// close file, do not delete stdin!
+		if ( out != &stdout ) delete( out );			// close file, do not delete stdout!
+	} // try
 } // main
 
Index: tests/.in/copyfile.txt
===================================================================
--- tests/.in/copyfile.txt	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ tests/.in/copyfile.txt	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
@@ -10,36 +10,37 @@
 // Created On       : Tue Jul 16 16:47:22 2019
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Jul 16 16:48:16 2019
-// Update Count     : 1
+// Last Modified On : Wed Jul 17 18:04:44 2019
+// Update Count     : 26
 // 
 
 #include <fstream.hfa>
+#include <stdlib.hfa>									// new/delete
 
 int main( int argc, char * argv[] ) {
-    ifstream & in  = stdin;				// default files
-    ofstream & out = stdout;
-    try {
-	choose ( argc ) {
-	  case 2, 3:
-	    open( in, argv[1] );			// open input file first as output creates file
-	    if ( argc == 3 ) open( out, argv[2] );	// only open output if input opens as output created if nonexistent
-	  case 1: ;					// use default files
-	  default:
-	    exit | "Usage [ input-file (default stdin) [ output-file (default stdout) ] ]";
-	} // choose
+	ifstream * in  = &stdin;							// default files
+	ofstream * out = &stdout;
+	try {
+		choose ( argc ) {
+		  case 2, 3:
+			  in = new( (const char *)argv[1] );		// open input file first as output creates file
+			  if ( argc == 3 ) out = new( (const char *)argv[2] ); // only open output if input opens as output created if nonexistent
+		  case 1: ;					// use default files
+		  default:
+			  exit | "Usage [ input-file (default stdin) [ output-file (default stdout) ] ]";
+		} // choose
 
-	char ch;
-	out | nlOff;					// turn off auto newline
-	in  | nlOn;					// turn on reading newline
+		char ch;
+		*out | nlOff;									// turn off auto newline
+		*in  | nlOn;									// turn on reading newline
 
-	for () {					// read all characters
-	    in | ch;
-	  if ( eof( in ) ) break;			// eof ?
-	    out | ch;
-	} // for
-    } finally {
-	close( in );					// stdin, stdout are never closed
-	close( out );
-    } // try
+		for () {										// read all characters
+			*in | ch;
+		  if ( eof( *in ) ) break;						// eof ?
+			*out | ch;
+		} // for
+	} finally {
+		if ( in  != &stdin  ) delete( in );				// close file, do not delete stdin!
+		if ( out != &stdout ) delete( out );			// close file, do not delete stdout!
+	} // try
 } // main
 
Index: tests/copyfile.cfa
===================================================================
--- tests/copyfile.cfa	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ tests/copyfile.cfa	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
@@ -10,36 +10,37 @@
 // Created On       : Tue Jul 16 16:47:22 2019
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Jul 16 16:48:16 2019
-// Update Count     : 1
+// Last Modified On : Wed Jul 17 18:04:44 2019
+// Update Count     : 26
 // 
 
 #include <fstream.hfa>
+#include <stdlib.hfa>									// new/delete
 
 int main( int argc, char * argv[] ) {
-    ifstream & in  = stdin;				// default files
-    ofstream & out = stdout;
-    try {
-	choose ( argc ) {
-	  case 2, 3:
-	    open( in, argv[1] );			// open input file first as output creates file
-	    if ( argc == 3 ) open( out, argv[2] );	// only open output if input opens as output created if nonexistent
-	  case 1: ;					// use default files
-	  default:
-	    exit | "Usage [ input-file (default stdin) [ output-file (default stdout) ] ]";
-	} // choose
+	ifstream * in  = &stdin;							// default files
+	ofstream * out = &stdout;
+	try {
+		choose ( argc ) {
+		  case 2, 3:
+			  in = new( (const char *)argv[1] );		// open input file first as output creates file
+			  if ( argc == 3 ) out = new( (const char *)argv[2] ); // only open output if input opens as output created if nonexistent
+		  case 1: ;					// use default files
+		  default:
+			  exit | "Usage [ input-file (default stdin) [ output-file (default stdout) ] ]";
+		} // choose
 
-	char ch;
-	out | nlOff;					// turn off auto newline
-	in  | nlOn;					// turn on reading newline
+		char ch;
+		*out | nlOff;									// turn off auto newline
+		*in  | nlOn;									// turn on reading newline
 
-	for () {					// read all characters
-	    in | ch;
-	  if ( eof( in ) ) break;			// eof ?
-	    out | ch;
-	} // for
-    } finally {
-	close( in );					// stdin, stdout are never closed
-	close( out );
-    } // try
+		for () {										// read all characters
+			*in | ch;
+		  if ( eof( *in ) ) break;						// eof ?
+			*out | ch;
+		} // for
+	} finally {
+		if ( in  != &stdin  ) delete( in );				// close file, do not delete stdin!
+		if ( out != &stdout ) delete( out );			// close file, do not delete stdout!
+	} // try
 } // main
 
Index: tests/heap.cfa
===================================================================
--- tests/heap.cfa	(revision 613030442f362a4878b5e0a61072d35233a565ed)
+++ tests/heap.cfa	(revision 83b52f10c32ca12f8f96a9532884e06dd2d083dd)
@@ -10,6 +10,6 @@
 // Created On       : Tue Nov  6 17:54:56 2018
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Dec 11 21:52:40 2018
-// Update Count     : 18
+// Last Modified On : Fri Jul 19 08:22:34 2019
+// Update Count     : 19
 // 
 
@@ -29,5 +29,5 @@
 #define __U_DEFAULT_MMAP_START__ (512 * 1024 + 1)
 size_t default_mmap_start() __attribute__(( weak )) {
-    return __U_DEFAULT_MMAP_START__;
+	return __U_DEFAULT_MMAP_START__;
 } // default_mmap_start
 
@@ -36,11 +36,11 @@
 
 void main( Worker & ) {
-    enum { NoOfAllocs = 5000, NoOfMmaps = 10 };
-    char * locns[NoOfAllocs];
-    int i;
-
-    // check alloc/free
-
-    for ( j; 40 ) {
+	enum { NoOfAllocs = 5000, NoOfMmaps = 10 };
+	char * locns[NoOfAllocs];
+	int i;
+
+	// check alloc/free
+
+	for ( j; 40 ) {
 		for ( i; NoOfAllocs ) {
 			locns[i] = alloc( i );
@@ -67,9 +67,9 @@
 			free( locns[i] );
 		} // for
-    } // for
-
-    // check malloc/free (sbrk)
-
-    for ( i; NoOfAllocs ) {
+	} // for
+
+	// check malloc/free (sbrk)
+
+	for ( i; NoOfAllocs ) {
 		size_t s = (i + 1) * 20;
 		char * area = (char *)malloc( s );
@@ -78,7 +78,7 @@
 		area[malloc_usable_size( area ) - 1] = '\345';	// fill ultimate byte
 		free( area );
-    } // for
-
-    for ( i; NoOfAllocs ) {
+	} // for
+
+	for ( i; NoOfAllocs ) {
 		size_t s = i + 1;								// +1 to make initialization simpler
 		locns[i] = (char *)malloc( s );
@@ -86,15 +86,15 @@
 		locns[i][0] = '\345'; locns[i][s - 1] = '\345';	// fill first/last
 		locns[i][malloc_usable_size( locns[i] ) - 1] = '\345'; // fill ultimate byte
-    } // for
-    for ( i; NoOfAllocs ) {
+	} // for
+	for ( i; NoOfAllocs ) {
 		size_t s = i + 1;
 		if ( locns[i][0] != '\345' || locns[i][s - 1] != '\345' ||
 			 locns[i][malloc_usable_size( locns[i] ) - 1] != '\345' ) abort( "malloc/free corrupt storage" );
 		free( locns[i] );
-    } // for
-
-    // check malloc/free (mmap)
-
-    for ( i; NoOfMmaps ) {
+	} // for
+
+	// check malloc/free (mmap)
+
+	for ( i; NoOfMmaps ) {
 		size_t s = i + default_mmap_start();			// cross over point
 		char * area = (char *)malloc( s );
@@ -103,7 +103,7 @@
 		area[malloc_usable_size( area ) - 1] = '\345';	// fill ultimate byte
 		free( area );
-    } // for
-
-    for ( i; NoOfMmaps ) {
+	} // for
+
+	for ( i; NoOfMmaps ) {
 		size_t s = i + default_mmap_start();			// cross over point
 		locns[i] = (char *)malloc( s );
@@ -111,15 +111,15 @@
 		locns[i][0] = '\345'; locns[i][s - 1] = '\345';	// fill first/last
 		locns[i][malloc_usable_size( locns[i] ) - 1] = '\345'; // fill ultimate byte
-    } // for
-    for ( i; NoOfMmaps ) {
+	} // for
+	for ( i; NoOfMmaps ) {
 		size_t s = i + default_mmap_start();			// cross over point
 		if ( locns[i][0] != '\345' || locns[i][s - 1] != '\345' ||
 			 locns[i][malloc_usable_size( locns[i] ) - 1] != '\345' ) abort( "malloc/free corrupt storage" );
 		free( locns[i] );
-    } // for
-
-    // check calloc/free (sbrk)
-
-    for ( i; NoOfAllocs ) {
+	} // for
+
+	// check calloc/free (sbrk)
+
+	for ( i; NoOfAllocs ) {
 		size_t s = (i + 1) * 20;
 		char * area = (char *)calloc( 5, s );
@@ -131,7 +131,7 @@
 		area[malloc_usable_size( area ) - 1] = '\345';	// fill ultimate byte
 		free( area );
-    } // for
-
-    for ( i; NoOfAllocs ) {
+	} // for
+
+	for ( i; NoOfAllocs ) {
 		size_t s = i + 1;
 		locns[i] = (char *)calloc( 5, s );
@@ -142,15 +142,15 @@
 		locns[i][0] = '\345'; locns[i][s - 1] = '\345';	// fill first/last
 		locns[i][malloc_usable_size( locns[i] ) - 1] = '\345'; // fill ultimate byte
-    } // for
-    for ( i; NoOfAllocs ) {
+	} // for
+	for ( i; NoOfAllocs ) {
 		size_t s = i + 1;
 		if ( locns[i][0] != '\345' || locns[i][s - 1] != '\345' ||
 			 locns[i][malloc_usable_size( locns[i] ) - 1] != '\345' ) abort( "calloc/free corrupt storage3" );
 		free( locns[i] );
-    } // for
-
-    // check calloc/free (mmap)
-
-    for ( i; NoOfMmaps ) {
+	} // for
+
+	// check calloc/free (mmap)
+
+	for ( i; NoOfMmaps ) {
 		size_t s = i + default_mmap_start();			// cross over point
 		char * area = (char *)calloc( 1, s );
@@ -162,7 +162,7 @@
 		area[malloc_usable_size( area ) - 1] = '\345';	// fill ultimate byte
 		free( area );
-    } // for
-
-    for ( i; NoOfMmaps ) {
+	} // for
+
+	for ( i; NoOfMmaps ) {
 		size_t s = i + default_mmap_start();			// cross over point
 		locns[i] = (char *)calloc( 1, s );
@@ -173,15 +173,15 @@
 		locns[i][0] = '\345'; locns[i][s - 1] = '\345';	// fill first/last
 		locns[i][malloc_usable_size( locns[i] ) - 1] = '\345'; // fill ultimate byte
-    } // for
-    for ( i; NoOfMmaps ) {
+	} // for
+	for ( i; NoOfMmaps ) {
 		size_t s = i + default_mmap_start();			// cross over point
 		if ( locns[i][0] != '\345' || locns[i][s - 1] != '\345' ||
 			 locns[i][malloc_usable_size( locns[i] ) - 1] != '\345' ) abort( "calloc/free corrupt storage6" );
 		free( locns[i] );
-    } // for
-
-    // check memalign/free (sbrk)
-
-    enum { limit = 64 * 1024 };							// check alignments up to here
+	} // for
+
+	// check memalign/free (sbrk)
+
+	enum { limit = 64 * 1024 };							// check alignments up to here
 
 	for ( a; libAlign() ~= limit ~ a ) {				// generate powers of 2
@@ -198,7 +198,7 @@
 			free( area );
 		} // for
-    } // for
-
-    // check memalign/free (mmap)
+	} // for
+
+	// check memalign/free (mmap)
 
 	for ( a; libAlign() ~= limit ~ a ) {				// generate powers of 2
@@ -216,9 +216,9 @@
 			free( area );
 		} // for
-    } // for
-
-    // check calloc/realloc/free (sbrk)
-
-    for ( i; 1 ~ 10_000 ~ 12 ) {
+	} // for
+
+	// check calloc/realloc/free (sbrk)
+
+	for ( i; 1 ~ 10_000 ~ 12 ) {
 		// initial N byte allocation
 		char * area = (char *)calloc( 5, i );
@@ -237,9 +237,9 @@
 		} // for
 		free( area );
-    } // for
-
-    // check calloc/realloc/free (mmap)
-
-    for ( i; 1 ~ 10_000 ~ 12 ) {
+	} // for
+
+	// check calloc/realloc/free (mmap)
+
+	for ( i; 1 ~ 10_000 ~ 12 ) {
 		// initial N byte allocation
 		size_t s = i + default_mmap_start();			// cross over point
@@ -259,9 +259,9 @@
 		} // for
 		free( area );
-    } // for
-
-    // check memalign/realloc/free
-
-    size_t amount = 2;
+	} // for
+
+	// check memalign/realloc/free
+
+	size_t amount = 2;
 	for ( a; libAlign() ~= limit ~ a ) {				// generate powers of 2
 		// initial N byte allocation
@@ -286,7 +286,7 @@
 		} // for
 		free( area );
-    } // for
-
-    // check cmemalign/free
+	} // for
+
+	// check cmemalign/free
 
 	for ( a; libAlign() ~= limit ~ a ) {				// generate powers of 2
@@ -305,9 +305,9 @@
 			free( area );
 		} // for
-    } // for
-
-    // check cmemalign/realloc/free
-
-    amount = 2;
+	} // for
+
+	// check cmemalign/realloc/free
+
+	amount = 2;
 	for ( a; libAlign() ~= limit ~ a ) {				// generate powers of 2
 		// initial N byte allocation
@@ -338,16 +338,16 @@
 		} // for
 		free( area );
-    } // for
+	} // for
 	//sout | "worker" | thisTask() | "successful completion";
 } // Worker main
 
 int main() {
-    const unsigned int NoOfWorkers = 4;
-    {
+	const unsigned int NoOfWorkers = 4;
+	{
 		processor processors[NoOfWorkers - 1] __attribute__(( unused )); // more than one processor
 		Worker workers[NoOfWorkers] __attribute__(( unused ));
-    }
+	}
 	// checkFreeOn();
-    // malloc_stats();
+	// malloc_stats();
 }
 
