Index: doc/user/user.tex
===================================================================
--- doc/user/user.tex	(revision a0297141bb69876b96202a3ccbe63d79eea4c362)
+++ doc/user/user.tex	(revision 5e8d732708a3890c61f7eaff07bb0bffd32402cf)
@@ -11,6 +11,6 @@
 %% Created On       : Wed Apr  6 14:53:29 2016
 %% Last Modified By : Peter A. Buhr
-%% Last Modified On : Wed May 24 22:21:42 2017
-%% Update Count     : 1994
+%% Last Modified On : Tue May 30 09:08:16 2017
+%% Update Count     : 2072
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -135,8 +135,8 @@
 
 \CFA{}\index{cforall@\CFA}\footnote{Pronounced ``\Index*{C-for-all}'', and written \CFA, CFA, or \CFL.} is a modern general-purpose programming-language, designed as an evolutionary step forward for the C programming language.
-The syntax of the \CFA language builds from C, and should look immediately familiar to C/\Index*[C++]{\CC} programmers.
-% Any language feature that is not described here can be assumed to be using the standard C11 syntax.
+The syntax of the \CFA language builds from C, and should look immediately familiar to C/\Index*[C++]{\CC{}} programmers.
+% Any language feature that is not described here can be assumed to be using the standard \Celeven syntax.
 \CFA adds many modern programming-language features that directly lead to increased \emph{\Index{safety}} and \emph{\Index{productivity}}, while maintaining interoperability with existing C programs and achieving C performance.
-Like C, \CFA is a statically typed, procedural language with a low-overhead runtime, meaning there is no global \Index{garbage-collection}, but \Index{regional garbage-collection}\index{garbage collection!regional} is possible.
+Like C, \CFA is a statically typed, procedural language with a low-overhead runtime, meaning there is no global \Index{garbage-collection}, but \Index{regional garbage-collection}\index{garbage-collection!regional} is possible.
 The primary new features include parametric-polymorphic routines and types, exceptions, concurrency, and modules.
 
@@ -147,14 +147,14 @@
 instead, a programmer evolves an existing C program into \CFA by incrementally incorporating \CFA features.
 New programs can be written in \CFA using a combination of C and \CFA features.
-\Index*[C++]{\CC} had a similar goal 30 years ago, but currently has the disadvantages of multiple legacy design-choices that cannot be updated and active divergence of the language model from C, requiring significant effort and training to incrementally add \CC to a C-based project.
+\Index*[C++]{\CC{}} had a similar goal 30 years ago, but currently has the disadvantages of multiple legacy design-choices that cannot be updated and active divergence of the language model from C, requiring significant effort and training to incrementally add \CC to a C-based project.
 In contrast, \CFA has 30 years of hindsight and a clean starting point.
 
-Like \Index*[C++]{\CC}, there may be both an old and new ways to achieve the same effect.
-For example, the following programs compare the \CFA, C, nad \CC I/O mechanisms, where the programs output the same result.
+Like \Index*[C++]{\CC{}}, there may be both an old and new ways to achieve the same effect.
+For example, the following programs compare the \CFA, C, and \CC I/O mechanisms, where the programs output the same result.
 \begin{quote2}
 \begin{tabular}{@{}l@{\hspace{1.5em}}l@{\hspace{1.5em}}l@{}}
 \multicolumn{1}{c@{\hspace{1.5em}}}{\textbf{\CFA}}	& \multicolumn{1}{c}{\textbf{C}}	& \multicolumn{1}{c}{\textbf{\CC}}	\\
 \begin{cfa}
-#include <fstream>
+#include <fstream>§\indexc{fstream}§
 
 int main( void ) {
@@ -165,5 +165,5 @@
 &
 \begin{lstlisting}
-#include <stdio.h>
+#include <stdio.h>§\indexc{stdio.h}§
 
 int main( void ) {
@@ -174,5 +174,5 @@
 &
 \begin{lstlisting}
-#include <iostream>
+#include <iostream>§\indexc{iostream}§
 using namespace std;
 int main() {
@@ -183,5 +183,5 @@
 \end{tabular}
 \end{quote2}
-While the \CFA I/O looks similar to the \Index*[C++]{\CC} output style, there are important differences, such as automatic spacing between variables as in \Index*{Python} (see~\VRef{s:IOLibrary}).
+While the \CFA I/O looks similar to the \Index*[C++]{\CC{}} output style, there are important differences, such as automatic spacing between variables as in \Index*{Python} (see~\VRef{s:IOLibrary}).
 
 This document is a user manual for the \CFA programming language, targeted at \CFA programmers.
@@ -197,5 +197,5 @@
 Even with all its problems, C continues to be popular because it allows writing software at virtually any level in a computer system without restriction.
 For system programming, where direct access to hardware and dealing with real-time issues is a requirement, C is usually the language of choice.
-The TIOBE index~\cite{TIOBE} for March 2016 showed the following programming-language popularity: \Index*{Java} 20.5\%, C 14.5\%, \Index*[C++]{\CC} 6.7\%, \Csharp 4.3\%, \Index*{Python} 4.3\%, where the next 50 languages are less than 3\% each with a long tail.
+The TIOBE index~\cite{TIOBE} for March 2016 showed the following programming-language popularity: \Index*{Java} 20.5\%, C 14.5\%, \Index*[C++]{\CC{}} 6.7\%, \Csharp 4.3\%, \Index*{Python} 4.3\%, where the next 50 languages are less than 3\% each with a long tail.
 As well, for 30 years, C has been the number 1 and 2 most popular programming language:
 \begin{center}
@@ -225,9 +225,9 @@
 These costs can be prohibitive for many companies with a large software base in C/\CC, and a significant number of programmers requiring retraining to a new programming language.
 
-The result of this project is a language that is largely backwards compatible with \Index*{C11}~\cite{C11}, but fixing some of the well known C problems and containing many modern language features.
+The result of this project is a language that is largely backwards compatible with \Index*[C11]{\Celeven{}}~\cite{C11}, but fixing some of the well known C problems and containing many modern language features.
 Without significant extension to the C programming language, it is becoming unable to cope with the needs of modern programming problems and programmers;
 as a result, it will fade into disuse.
 Considering the large body of existing C code and programmers, there is significant impetus to ensure C is transformed into a modern programming language.
-While \Index*{C11} made a few simple extensions to the language, nothing was added to address existing problems in the language or to augment the language with modern language features.
+While \Index*[C11]{\Celeven{}} made a few simple extensions to the language, nothing was added to address existing problems in the language or to augment the language with modern language features.
 While some may argue that modern language features may make C complex and inefficient, it is clear a language without modern capabilities is insufficient for the advanced programming problems existing today.
 
@@ -243,5 +243,5 @@
 int forty_two = identity( 42 );			§\C{// T is bound to int, forty\_two == 42}§
 \end{lstlisting}
-% extending the C type system with parametric polymorphism and overloading, as opposed to the \Index*[C++]{\CC} approach of object-oriented extensions.
+% extending the C type system with parametric polymorphism and overloading, as opposed to the \Index*[C++]{\CC{}} approach of object-oriented extensions.
 \CFA{}\hspace{1pt}'s polymorphism was originally formalized by Ditchfiled~\cite{Ditchfield92}, and first implemented by Bilson~\cite{Bilson03}.
 However, at that time, there was little interesting in extending C, so work did not continue.
@@ -262,5 +262,5 @@
 A simple example is leveraging the existing type-unsafe (©void *©) C ©bsearch© to binary search a sorted floating-point array:
 \begin{lstlisting}
-void * bsearch( const void * key, const void * base, size_t nmemb, size_t size,
+void * bsearch( const void * key, const void * base, size_t dim, size_t size,
 				int (* compar)( const void *, const void * ));
 
@@ -340,6 +340,8 @@
 The 1999 C standard plus GNU extensions.
 \item
+{\lstset{deletekeywords={inline}}
 \Indexc{-fgnu89-inline}\index{compilation option!-fgnu89-inline@{©-fgnu89-inline©}}
 Use the traditional GNU semantics for inline routines in C99 mode, which allows inline routines in header files.
+}%
 \end{description}
 The following new \CFA options are available:
@@ -412,7 +414,7 @@
 \begin{cfa}
 #ifndef __CFORALL__
-#include <stdio.h>						§\C{// C header file}§
+#include <stdio.h>§\indexc{stdio.h}§	§\C{// C header file}§
 #else
-#include <fstream>						§\C{// \CFA header file}§
+#include <fstream>§\indexc{fstream}§	§\C{// \CFA header file}§
 #endif
 \end{cfa}
@@ -747,5 +749,5 @@
 p2 = p1 + x;					§\C{// compiler infers *p2 = *p1 + x;}§
 \end{cfa}
-Algol68 infers the following deferencing ©*p2 = *p1 + x©, because adding the arbitrary integer value in ©x© to the address of ©p1© and storing the resulting address into ©p2© is an unlikely operation.
+Algol68 infers the following dereferencing ©*p2 = *p1 + x©, because adding the arbitrary integer value in ©x© to the address of ©p1© and storing the resulting address into ©p2© is an unlikely operation.
 Unfortunately, automatic dereferencing does not work in all cases, and so some mechanism is necessary to fix incorrect choices. 
 
@@ -1421,5 +1423,5 @@
 
 Given the \CFA restrictions above, both named and default arguments are backwards compatible.
-\Index*[C++]{\CC} only supports default arguments;
+\Index*[C++]{\CC{}} only supports default arguments;
 \Index*{Ada} supports both named and default arguments.
 
@@ -1455,5 +1457,5 @@
 \subsection{Type Nesting}
 
-\CFA allows \Index{type nesting}, and type qualification of the nested typres (see \VRef[Figure]{f:TypeNestingQualification}), where as C hoists\index{type hoisting} (refactors) nested types into the enclosing scope and has no type qualification.
+\CFA allows \Index{type nesting}, and type qualification of the nested types (see \VRef[Figure]{f:TypeNestingQualification}), where as C hoists\index{type hoisting} (refactors) nested types into the enclosing scope and has no type qualification.
 \begin{figure}
 \centering
@@ -1768,5 +1770,5 @@
 \index{lvalue}
 The left-hand side is a tuple of \emph{lvalues}, and the right-hand side is a tuple of \emph{expr}s.
-Each \emph{expr} appearing on the righthand side of a multiple assignment statement is assigned to the corresponding \emph{lvalues} on the left-hand side of the statement using parallel semantics for each assignment.
+Each \emph{expr} appearing on the right-hand side of a multiple assignment statement is assigned to the corresponding \emph{lvalues} on the left-hand side of the statement using parallel semantics for each assignment.
 An example of multiple assignment is:
 \begin{cfa}
@@ -1861,5 +1863,5 @@
 While C provides ©continue© and ©break© statements for altering control flow, both are restricted to one level of nesting for a particular control structure.
 Unfortunately, this restriction forces programmers to use \Indexc{goto} to achieve the equivalent control-flow for more than one level of nesting.
-To prevent having to switch to the ©goto©, \CFA extends the \Indexc{continue}\index{continue@©continue©!labelled}\index{labelled!continue@©continue©} and \Indexc{break}\index{break@©break©!labelled}\index{labelled!break@©break©} with a target label to support static multi-level exit\index{multi-level exit}\index{static multi-level exit}~\cite{Buhr85,Java}.
+To prevent having to switch to the ©goto©, \CFA extends the \Indexc{continue}\index{continue@\lstinline $continue$!labelled}\index{labelled!continue@©continue©} and \Indexc{break}\index{break@\lstinline $break$!labelled}\index{labelled!break@©break©} with a target label to support static multi-level exit\index{multi-level exit}\index{static multi-level exit}~\cite{Buhr85,Java}.
 For both ©continue© and ©break©, the target label must be directly associated with a ©for©, ©while© or ©do© statement;
 for ©break©, the target label can also be associated with a ©switch©, ©if© or compound (©{}©) statement.
@@ -1901,5 +1903,5 @@
 		if ( ... ) {
 			for ( ... ) {
-				for ( ... ) {
+				while ( ... ) {
 					... goto ®LC®; ...
 					... goto ®LS®; ...
@@ -1922,5 +1924,55 @@
 \end{figure}
 
-Both labelled ©continue© and ©break© are a ©goto©\index{goto@©goto©!restricted} restricted in the following ways:
+\begin{comment}
+int main() {
+  LC: {
+	  LS: switch ( 1 ) {
+		  case 3:
+		  LIF: if ( 1 ) {
+			  LF: for ( ;; ) {
+				  LW: while ( 1 ) {
+						break LC;			// terminate compound
+						break LS;			// terminate switch
+						break LIF;			// terminate if
+						continue LF;	 // resume loop
+						break LF;			// terminate loop
+						continue LW;	 // resume loop
+						break LW;		  // terminate loop
+					} // while
+				} // for
+			} else {
+				break LIF;					 // terminate if
+			} // if
+		} // switch
+	} // compound
+	{
+		switch ( 1 ) {
+		  case 3:
+			if ( 1 ) {
+				for ( ;; ) {
+					while ( 1 ) {
+						goto LCx;
+						goto LSx;
+						goto LIF;
+						goto LFC;
+						goto LFB;
+						goto LWC;
+						goto LWB;
+					  LWC: ; } LWB: ;
+				  LFC: ; } LFB: ;
+			} else {
+				goto LIF;
+			} L3: ;
+		} LSx: ;
+	} LCx: ;
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// End: //
+\end{comment}
+
+
+Both labelled ©continue© and ©break© are a ©goto©\index{goto@\lstinline $goto$!restricted} restricted in the following ways:
 \begin{itemize}
 \item
@@ -2249,4 +2301,6 @@
 
 The goal of \CFA I/O is to simplify the common cases\index{I/O!common case}, while fully supporting polymorphism and user defined types in a consistent way.
+The \CFA header file for the I/O library is \Indexc{fstream}.
+
 The common case is printing out a sequence of variables separated by whitespace.
 \begin{quote2}
@@ -2306,5 +2360,5 @@
 
 
-The implicit separator\index{I/O separator} character (space/blank) is a separator not a terminator.
+The implicit separator\index{I/O!separator} character (space/blank) is a separator not a terminator.
 The rules for implicitly adding the separator are:
 \begin{enumerate}
@@ -2334,5 +2388,5 @@
 
 \item
-A separator does not appear before a C string starting with the (extended) \Index{ASCII}\index{ASCII!extended} characters: \lstinline[mathescape=off,basicstyle=\tt]@([{=$£¥¡¿«@
+A separator does not appear before a C string starting with the (extended) \Index*{ASCII}\index{ASCII!extended} characters: \lstinline[mathescape=off,basicstyle=\tt]@([{=$£¥¡¿«@
 %$
 \begin{cfa}[mathescape=off]
@@ -2349,5 +2403,5 @@
 \item
 {\lstset{language=CFA,deletedelim=**[is][]{¢}{¢}}
-A seperator does not appear after a C string ending with the (extended) \Index{ASCII}\index{ASCII!extended} characters: \lstinline[basicstyle=\tt]@,.;!?)]}%¢»@
+A seperator does not appear after a C string ending with the (extended) \Index*{ASCII}\index{ASCII!extended} characters: \lstinline[basicstyle=\tt]@,.;!?)]}%¢»@
 \begin{cfa}[belowskip=0pt]
 sout | 1 | ", x" | 2 | ". x" | 3 | "; x" | 4 | "! x" | 5 | "? x" | 6 | "% x"
@@ -2360,5 +2414,5 @@
 
 \item
-A seperator does not appear before or after a C string begining/ending with the \Index{ASCII} quote or whitespace characters: \lstinline[basicstyle=\tt,showspaces=true]@`'": \t\v\f\r\n@
+A seperator does not appear before or after a C string begining/ending with the \Index*{ASCII} quote or whitespace characters: \lstinline[basicstyle=\tt,showspaces=true]@`'": \t\v\f\r\n@
 \begin{cfa}[belowskip=0pt]
 sout | "x`" | 1 | "`x'" | 2 | "'x\"" | 3 | "\"x:" | 4 | ":x " | 5 | " x\t" | 6 | "\tx" | endl;
@@ -2630,5 +2684,5 @@
 
 \CFA supports C initialization of structures, but it also adds constructors for more advanced initialization.
-Additionally, \CFA adds destructors that are called when a variable is de-allocated (variable goes out of scope or object is deleted).
+Additionally, \CFA adds destructors that are called when a variable is deallocated (variable goes out of scope or object is deleted).
 These functions take a reference to the structure as a parameter (see References for more information).
 
@@ -2963,10 +3017,10 @@
 Generics allow programmers to use type variables in place of concrete types so that the code can be reused with multiple types.
 The type parameters can be restricted to satisfy a set of constraints.
-This enables \CFA to build fully compiled generic functions and types, unlike other languages like \Index*[C++]{\CC} where templates are expanded or must be explicitly instantiated.
+This enables \CFA to build fully compiled generic functions and types, unlike other languages like \Index*[C++]{\CC{}} where templates are expanded or must be explicitly instantiated.
 
 
 \subsection{Generic Functions}
 
-Generic functions in \CFA are similar to template functions in \Index*[C++]{\CC}, and will sometimes be expanded into specialized versions, just like in \CC.
+Generic functions in \CFA are similar to template functions in \Index*[C++]{\CC{}}, and will sometimes be expanded into specialized versions, just like in \CC.
 The difference, however, is that generic functions in \CFA can also be separately compiled, using function pointers for callers to pass in all needed functionality for the given type.
 This means that compiled libraries can contain generic functions that can be used by programs linked with them (statically or dynamically).
@@ -3087,5 +3141,5 @@
 
 Generic types are defined using the same mechanisms as those described above for generic functions.
-This feature allows users to create types that have one or more fields that use generic parameters as types, similar to a template classes in \Index*[C++]{\CC}.
+This feature allows users to create types that have one or more fields that use generic parameters as types, similar to a template classes in \Index*[C++]{\CC{}}.
 For example, to make a generic linked list, a placeholder is created for the type of the elements, so that the specific type of the elements in the list need not be specified when defining the list.
 In C, something like this would have to be done using void pointers and unsafe casting.
@@ -3139,5 +3193,5 @@
 Throwing an exception terminates execution of the current block, invokes the destructors of variables that are local to the block, and propagates the exception to the parent block.
 The exception is immediately re-thrown from the parent block unless it is caught as described below.
-\CFA uses keywords similar to \Index*[C++]{\CC} for exception handling.
+\CFA uses keywords similar to \Index*[C++]{\CC{}} for exception handling.
 An exception is thrown using a throw statement, which accepts one argument.
 
@@ -3345,5 +3399,5 @@
 
 A task may define a constructor, which will be called upon allocation and run on the caller.s thread.
-A destructor may also be defined, which is called at de-allocation (when a dynamic object is deleted or when a local object goes out of scope).
+A destructor may also be defined, which is called at deallocation (when a dynamic object is deleted or when a local object goes out of scope).
 After a task is allocated and initialized, its thread is spawned implicitly and begins executing in its function call method.
 All tasks must define this function call method, with a void return value and no additional parameters, or the compiler will report an error.
@@ -3522,5 +3576,5 @@
 \subsection{No Declarations, No Header Files}
 
-In C and \Index*[C++]{\CC}, it is necessary to declare or define every global variable, global function, and type before it is used in each file.
+In C and \Index*[C++]{\CC{}}, it is necessary to declare or define every global variable, global function, and type before it is used in each file.
 Header files and a preprocessor are normally used to avoid repeating code.
 Thus, many variables, functions, and types are described twice, which exposes an opportunity for errors and causes additional maintenance work.
@@ -4167,5 +4221,5 @@
 In developing \CFA, many other languages were consulted for ideas, constructs, and syntax.
 Therefore, it is important to show how these languages each compare with Do.
-In this section, \CFA is compared with what the writers of this document consider to be the closest competitors of Do: \Index*[C++]{\CC}, \Index*{Go}, \Index*{Rust}, and \Index*{D}.
+In this section, \CFA is compared with what the writers of this document consider to be the closest competitors of Do: \Index*[C++]{\CC{}}, \Index*{Go}, \Index*{Rust}, and \Index*{D}.
 
 
@@ -4792,5 +4846,5 @@
 \subsubsection[C++]{\CC}
 
-\Index*[C++]{\CC} is a general-purpose programming language.
+\Index*[C++]{\CC{}} is a general-purpose programming language.
 It has imperative, object-oriented and generic programming features, while also providing facilities for low-level memory manipulation. (Wikipedia)
 
@@ -4977,5 +5031,5 @@
 }
 \end{cfa}
-\item[Rationale:] dropped from C11 standard.\footnote{
+\item[Rationale:] dropped from \Celeven standard.\footnote{
 At least one type specifier shall be given in the declaration specifiers in each declaration, and in the specifier-qualifier list in each structure declaration and type name~\cite[\S~6.7.2(2)]{C11}}
 \item[Effect on original feature:] original feature is deprecated. \\
@@ -5045,5 +5099,5 @@
 static struct X a = { 1, &b };	§\C{// definition}§
 \end{cfa}
-\item[Rationale:] avoids having different initialization rules for builtin types and userdefined types.
+\item[Rationale:] avoids having different initialization rules for builtin types and user-defined types.
 \item[Effect on original feature:] change to semantics of well-defined feature.
 \item[Difficulty of converting:] the initializer for one of a set of mutually-referential file-local static objects must invoke a routine call to achieve the initialization.
@@ -5070,5 +5124,5 @@
 \end{cfa}
 In C, the name of the nested types belongs to the same scope as the name of the outermost enclosing structure, \ie the nested types are hoisted to the scope of the outer-most type, which is not useful and confusing.
-\CFA is C \emph{incompatible} on this issue, and provides semantics similar to \Index*[C++]{\CC}.
+\CFA is C \emph{incompatible} on this issue, and provides semantics similar to \Index*[C++]{\CC{}}.
 Nested types are not hoisted and can be referenced using the field selection operator ``©.©'', unlike the \CC scope-resolution operator ``©::©''.
 \item[Rationale:] ©struct© scope is crucial to \CFA as an information structuring and hiding mechanism.
@@ -5086,5 +5140,5 @@
 struct Y;						§\C{// struct Y and struct X are at the same scope}§
 struct X {
-struct Y { /* ... */ } y;
+	struct Y { /* ... */ } y;
 };
 \end{cfa}
@@ -5108,62 +5162,63 @@
 \label{s:StandardHeaders}
 
-C11 prescribes the following standard header-files~\cite[\S~7.1.2]{C11} and \CFA adds to this list:
+\Celeven prescribes the following standard header-files~\cite[\S~7.1.2]{C11} and \CFA adds to this list:
 \begin{quote2}
-\begin{tabular}{llll|l}
+\lstset{deletekeywords={float},deletekeywords=[2]{signal}}
+\begin{tabular}{@{}llll|l@{}}
 \multicolumn{4}{c|}{C11} & \multicolumn{1}{c}{\CFA}		\\
 \hline
 \begin{tabular}{@{}l@{}}
-assert.h	\\
-complex.h	\\
-ctype.h		\\
-errno.h		\\
-fenv.h		\\
-float.h		\\
-inttypes.h	\\
-iso646.h	\\
+\Indexc{assert.h}		\\
+\Indexc{complex.h}		\\
+\Indexc{ctype.h}		\\
+\Indexc{errno.h}		\\
+\Indexc{fenv.h}			\\
+\Indexc{float.h}		\\
+\Indexc{inttypes.h}		\\
+\Indexc{iso646.h}		\\
 \end{tabular}
 &
 \begin{tabular}{@{}l@{}}
-limits.h	\\
-locale.h	\\
-math.h		\\
-setjmp.h	\\
-signal.h	\\
-stdalign.h	\\
-stdarg.h	\\
-stdatomic.h	\\
+\Indexc{limits.h}		\\
+\Indexc{locale.h}		\\
+\Indexc{math.h}			\\
+\Indexc{setjmp.h}		\\
+\Indexc{signal.h}		\\
+\Indexc{stdalign.h}		\\
+\Indexc{stdarg.h}		\\
+\Indexc{stdatomic.h}	\\
 \end{tabular}
 &
 \begin{tabular}{@{}l@{}}
-stdbool.h	\\
-stddef.h	\\
-stdint.h	\\
-stdio.h		\\
-stdlib.h	\\
-stdnoreturn.h \\
-string.h	\\
-tgmath.h	\\
+\Indexc{stdbool.h}		\\
+\Indexc{stddef.h}		\\
+\Indexc{stdint.h}		\\
+\Indexc{stdio.h}		\\
+\Indexc{stdlib.h}		\\
+\Indexc{stdnoreturn.h}	\\
+\Indexc{string.h}		\\
+\Indexc{tgmath.h}		\\
 \end{tabular}
 &
 \begin{tabular}{@{}l@{}}
-threads.h	\\
-time.h		\\
-uchar.h		\\
-wchar.h		\\
-wctype.h	\\
-			\\
-			\\
-			\\
+\Indexc{threads.h}		\\
+\Indexc{time.h}			\\
+\Indexc{uchar.h}		\\
+\Indexc{wchar.h}		\\
+\Indexc{wctype.h}		\\
+						\\
+						\\
+						\\
 \end{tabular}
 &
 \begin{tabular}{@{}l@{}}
-unistd.h	\\
-gmp.h		\\
-			\\
-			\\
-			\\
-			\\
-			\\
-			\\
+\Indexc{unistd.h}		\\
+\Indexc{gmp.h}			\\
+						\\
+						\\
+						\\
+						\\
+						\\
+						\\
 \end{tabular}
 \end{tabular}
@@ -5177,30 +5232,74 @@
 \label{s:StandardLibrary}
 
-The \CFA standard-library wraps explicitly-polymorphic C general-routines into implicitly-polymorphic versions.
-
-
-\subsection{malloc}
+The \CFA standard-library wraps explicitly-polymorphic C routines into implicitly-polymorphic versions.
+
+
+\subsection{Storage Management}
+
+The storage-management routines extend their C equivalents by overloading, alternate names, providing shallow type-safety, and removing the need to specify the allocation size for non-array types.
+\begin{center}
+\begin{tabular}{@{}r|l|l|l|l@{}}
+					& fill				& resize	& alignment	& array	\\
+\hline
+©malloc©			& no/yes			& no/yes	& no		& no	\\
+©amalloc©			& no/copy data/yes	& no/yes	& no		& yes	\\
+©calloc©			& yes (0 only)		& no		& no		& yes	\\
+©realloc©			& no/copy data		& yes		& no		& no	\\
+©memalign©			& no/yes			& no		& yes		& no	\\
+©amemalign©			& no/yes			& no		& yes		& yes	\\
+©align_alloc©		& no				& no		& yes		& no	\\
+©posix_memalign©	& no				& no		& yes		& no	\\
+\end{tabular}
+\end{center}
+When ©amalloc© resizes and fills, the space after the copied data from the source is set to the fill character.
+It is impossible to resize with alignment because the underlying ©realloc© allocates storage if more space is needed, and it does not honour alignment from the original allocation.
 
 \leavevmode
 \begin{cfa}[aboveskip=0pt,belowskip=0pt]
+// allocation, non-array types
 forall( dtype T | sized(T) ) T * malloc( void );§\indexc{malloc}§
 forall( dtype T | sized(T) ) T * malloc( char fill );
-forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size );
-forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size, unsigned char fill );
-forall( dtype T | sized(T) ) T * calloc( size_t nmemb );§\indexc{calloc}§
-forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size );§\indexc{ato}§
-forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size, unsigned char fill );
-
-forall( dtype T | sized(T) ) T * aligned_alloc( size_t alignment );§\indexc{ato}§
-forall( dtype T | sized(T) ) T * memalign( size_t alignment );		// deprecated
-forall( dtype T | sized(T) ) int posix_memalign( T ** ptr, size_t alignment );
-
-forall( dtype T, ttype Params | sized(T) | { void ?{}(T *, Params); } ) T * new( Params p );
-forall( dtype T | { void ^?{}(T *); } ) void delete( T * ptr );
-forall( dtype T, ttype Params | { void ^?{}(T *); void delete(Params); } ) void delete( T * ptr, Params rest );
-\end{cfa}
-
-
-\subsection{ato / strto}
+
+// allocation, array types
+forall( dtype T | sized(T) ) T * calloc( size_t dim );§\indexc{cmalloc}§
+forall( dtype T | sized(T) ) T * amalloc( size_t dim );§\indexc{amalloc}§  // alternate name for calloc
+forall( dtype T | sized(T) ) T * amalloc( size_t dim, char fill );
+
+// resize, non-array types
+forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size );§\indexc{realloc}§
+forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size, char fill );
+forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size );  // alternate name for realloc
+forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size, char fill );
+
+// resize, array types
+forall( dtype T | sized(T) ) T * amalloc( T * ptr, size_t dim );
+forall( dtype T | sized(T) ) T * amalloc( T * ptr, size_t dim, char fill );
+
+// alignment, non-array types
+forall( dtype T | sized(T) ) T * memalign( size_t alignment );§\indexc{memalign}§
+forall( dtype T | sized(T) ) T * memalign( size_t alignment, char fill );
+forall( dtype T | sized(T) ) T * aligned_alloc( size_t alignment );§\indexc{aligned_alloc}§
+forall( dtype T | sized(T) ) int posix_memalign( T ** ptr, size_t alignment );§\indexc{posix_memalign}§
+
+// alignment, array types
+forall( dtype T | sized(T) ) T * amemalign( size_t alignment, size_t dim );§\indexc{amemalign}§
+forall( dtype T | sized(T) ) T * amemalign( size_t alignment, size_t dim, char fill );
+
+// data, non-array types
+forall( dtype T | sized(T) ) T * memset( T * dest, char c );§\indexc{memset}§
+forall( dtype T | sized(T) ) T * memcpy( T * dest, const T * src );§\indexc{memcpy}§
+
+// data, array types
+forall( dtype T | sized(T) ) T * amemset( T * dest, size_t dim, char c );§\indexc{amemset}§
+forall( dtype T | sized(T) ) T * amemcpy( T * dest, const T * src, size_t dim );§\indexc{amemcpy}§
+
+// allocation/deallocation and constructor/destructor
+forall( dtype T, ttype Params | sized(T) | { void ?{}(T *, Params); } ) T * new( Params p );§\indexc{new}§
+forall( dtype T | { void ^?{}( T * ); } ) void delete( T * ptr );§\indexc{delete}§
+forall( dtype T, ttype Params | { void ^?{}( T * ); void delete(Params); } ) void delete( T * ptr, Params rest );
+\end{cfa}
+
+
+\subsection{Conversion}
 
 \leavevmode
@@ -5234,12 +5333,12 @@
 
 
-\subsection{bsearch / qsort}
+\subsection{Search / Sort}
 
 \leavevmode
 \begin{cfa}[aboveskip=0pt,belowskip=0pt]
-forall( otype T | { int ?<?( T, T ); } )	// location
+forall( otype T | { int ?<?( T, T ); } )	§\C{// location}§
 T * bsearch( T key, const T * arr, size_t dimension );§\indexc{bsearch}§
 
-forall( otype T | { int ?<?( T, T ); } )	// position
+forall( otype T | { int ?<?( T, T ); } )	§\C{// position}§
 unsigned int bsearch( T key, const T * arr, size_t dimension );
 
@@ -5249,5 +5348,5 @@
 
 
-\subsection{abs}
+\subsection{Absolute Value}
 
 \leavevmode
@@ -5268,5 +5367,5 @@
 
 
-\subsection{random}
+\subsection{Random Numbers}
 
 \leavevmode
@@ -5286,5 +5385,5 @@
 
 
-\subsection{min / max / clamp / swap}
+\subsection{Algorithms}
 
 \leavevmode
@@ -5671,7 +5770,7 @@
 \label{s:MultiPrecisionIntegers}
 
-\CFA has an interface to the \Index{GMP} \Index{multi-precision} signed-integers~\cite{GMP}, similar to the \CC interface provided by GMP.
+\CFA has an interface to the GMP \Index{multi-precision} signed-integers~\cite{GMP}, similar to the \CC interface provided by GMP.
 The \CFA interface wraps GMP routines into operator routines to make programming with multi-precision integers identical to using fixed-sized integers.
-The \CFA type name for multi-precision signed-integers is \Indexc{Int}.
+The \CFA type name for multi-precision signed-integers is \Indexc{Int} and the header file is \Indexc{gmp}.
 
 \begin{cfa}
@@ -5843,9 +5942,9 @@
 \hline
 \begin{cfa}
-#include <gmp>
+#include <gmp>§\indexc{gmp}§
 int main( void ) {
 	sout | "Factorial Numbers" | endl;
-	Int fact;
-	fact = 1;
+	Int fact = 1;
+
 	sout | 0 | fact | endl;
 	for ( unsigned int i = 1; i <= 40; i += 1 ) {
@@ -5857,5 +5956,5 @@
 &
 \begin{cfa}
-#include <gmp.h>
+#include <gmp.h>§\indexc{gmp.h}§
 int main( void ) {
 	®gmp_printf®( "Factorial Numbers\n" );
Index: c/examples/alloc.c
===================================================================
--- src/examples/alloc.c	(revision a0297141bb69876b96202a3ccbe63d79eea4c362)
+++ 	(revision )
@@ -1,118 +1,0 @@
-//                               -*- Mode: C -*- 
-// 
-// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// alloc.c -- 
-// 
-// Author           : Peter A. Buhr
-// Created On       : Wed Feb  3 07:56:22 2016
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Mar 11 17:42:08 2016
-// Update Count     : 59
-// 
-
-forall( otype T ) T * malloc( char fill );
-forall( dtype T ) T *?=?( T **, void * );
-void *malloc( unsigned long int );
-#if 0
-#include <fstream>
-#include <stdlib>
-extern "C" {
-#include <stdlib.h>										// access C malloc, realloc
-#include <stdio.h>
-} // exten "C"
-
-int * foo( int * p, int c ) { return p; }
-int * bar( int * p, int c ) { return p; }
-int * baz( int * p, int c ) { return p; }
-#endif
-
-int main( void ) {
-#if 0
-    size_t size = 10;
-    int * p;
-    struct S { int x; double y; } * s;
-#endif
-
-#if 0
-    p = malloc( sizeof(*p) );							// C malloc, type unsafe
-	printf( "here1\n" );
-    free( p );
-    p = malloc();										// CFA malloc, type safe
-	printf( "here2\n" );
-    free( p );
-#endif
-//    int * p;
-//    p = malloc( (char)'\0' );									// CFA malloc, type safe
-    (int *)malloc( (char)'\0' );									// CFA malloc, type safe
-    (void *)malloc( (char)'\0' );									// CFA malloc, type safe
-#if 0
-	printf( "here3\n" );
-    p = malloc( p, 1000 );								// CFA remalloc, type safe
-	printf( "here4\n" );
-    free( p );
-    p = calloc( size, sizeof(*p) );						// C calloc, type unsafe
-	printf( "here5\n" );
-    free( p );
-    p = calloc( size );									// CFA calloc, type safe
-	printf( "here6\n" );
-    free( p );
-    p = calloc( size );									// CFA calloc, type safe
-    p = realloc( p, 1000 );								// C realloc, type unsafe
-    p = realloc( p, 1000, '\0' );						// CFA realloc, type unsafe
-    p = memset( p );									// CFA memset, type unsafe
-	printf( "here7\n" );
-    free( p );
-    p = memalign( 16 );
-	printf( "here8\n" );
-    free( p );
-    posix_memalign( &p, 16 );
-	printf( "here9\n" );
-    free( p );
-
-    float * fp = malloc() + 1;
-    fprintf( stderr, "%p %p\n", fp, fp - 1 );
-    free( fp - 1 );
-    p = realloc( st1, size, '\0' );						// C realloc, type unsafe
-
-    double *y;
-    x = memset( st1, '\0' );							// SHOULD FAIL!!
-
-    int *p;
-    p = foo( bar( baz( malloc(), 0 ), 0 ), 0 );
-    free( p );
-
-    struct St2 { int x; double y; };
-    struct St2 * st2;
-
-    y = malloc();
-    st1 = malloc();
-//    st1 = realloc( st2, 10, st1 );
-  
-    *y = 1.0;
-    printf("%f\n", *y);
-
-    st1->x = *x + 1;
-    st1->y = *y *1.5;
-    printf("{ %d, %f }\n", st1->x, st1->y);
-
-    free( y );
-  
-    x = malloc( 10 );
-    for ( int i = 0; i < 10; i += 1 ) {
-	x[i] = i * 10;
-    }
-    for ( int j = 0; j < 10; j += 1 ) {
-	printf( "x[%d] = %d\n", j, x[j] );
-    }
-    free( x );
-#endif
-}
-
-// Local Variables: //
-// tab-width: 4 //
-// compile-command: "cfa alloc.c" //
-// End: //
Index: src/libcfa/gmp
===================================================================
--- src/libcfa/gmp	(revision a0297141bb69876b96202a3ccbe63d79eea4c362)
+++ src/libcfa/gmp	(revision 5e8d732708a3890c61f7eaff07bb0bffd32402cf)
@@ -10,6 +10,6 @@
 // Created On       : Tue Apr 19 08:43:43 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon May 22 08:32:39 2017
-// Update Count     : 13
+// Last Modified On : Sat May 27 09:55:51 2017
+// Update Count     : 14
 // 
 
@@ -22,130 +22,130 @@
 
 // constructor
-void ?{}( Int * this ) { mpz_init( this->mpz ); }
-void ?{}( Int * this, Int init ) { mpz_init_set( this->mpz, init.mpz ); }
-void ?{}( Int * this, zero_t ) { mpz_init_set_si( this->mpz, 0 ); }
-void ?{}( Int * this, one_t ) { mpz_init_set_si( this->mpz, 1 ); }
-void ?{}( Int * this, signed long int init ) { mpz_init_set_si( this->mpz, init ); }
-void ?{}( Int * this, unsigned long int init ) { mpz_init_set_ui( this->mpz, init ); }
-void ?{}( Int * this, const char * val ) { if ( mpz_init_set_str( this->mpz, val, 0 ) ) abort(); }
-void ^?{}( Int * this ) { mpz_clear( this->mpz ); }
+static inline void ?{}( Int * this ) { mpz_init( this->mpz ); }
+static inline void ?{}( Int * this, Int init ) { mpz_init_set( this->mpz, init.mpz ); }
+static inline void ?{}( Int * this, zero_t ) { mpz_init_set_si( this->mpz, 0 ); }
+static inline void ?{}( Int * this, one_t ) { mpz_init_set_si( this->mpz, 1 ); }
+static inline void ?{}( Int * this, signed long int init ) { mpz_init_set_si( this->mpz, init ); }
+static inline void ?{}( Int * this, unsigned long int init ) { mpz_init_set_ui( this->mpz, init ); }
+static inline void ?{}( Int * this, const char * val ) { if ( mpz_init_set_str( this->mpz, val, 0 ) ) abort(); }
+static inline void ^?{}( Int * this ) { mpz_clear( this->mpz ); }
 
 // assignment
-Int ?=?( Int * lhs, Int rhs ) { mpz_set( lhs->mpz, rhs.mpz ); return *lhs; }
-Int ?=?( Int * lhs, long int rhs ) { mpz_set_si( lhs->mpz, rhs ); return *lhs; }
-Int ?=?( Int * lhs, unsigned long int rhs ) { mpz_set_ui( lhs->mpz, rhs ); return *lhs; }
-Int ?=?( Int * lhs, const char * rhs ) { if ( mpz_set_str( lhs->mpz, rhs, 0 ) ) { printf( "invalid string conversion\n" ); abort(); } return *lhs; }
-
-char ?=?( char * lhs, Int rhs ) { char val = mpz_get_si( rhs.mpz ); *lhs = val; return val; }
-short int ?=?( short int * lhs, Int rhs ) { short int val = mpz_get_si( rhs.mpz ); *lhs = val; return val; }
-int ?=?( int * lhs, Int rhs ) { int val = mpz_get_si( rhs.mpz ); *lhs = val; return val; }
-long int ?=?( long int * lhs, Int rhs ) { long int val = mpz_get_si( rhs.mpz ); *lhs = val; return val; }
-unsigned char ?=?( unsigned char * lhs, Int rhs ) { unsigned char val = mpz_get_ui( rhs.mpz ); *lhs = val; return val; }
-unsigned short int ?=?( unsigned short int * lhs, Int rhs ) { unsigned short int val = mpz_get_ui( rhs.mpz ); *lhs = val; return val; }
-unsigned int ?=?( unsigned int * lhs, Int rhs ) { unsigned int val = mpz_get_ui( rhs.mpz ); *lhs = val; return val; }
-unsigned long int ?=?( unsigned long int * lhs, Int rhs ) { unsigned long int val = mpz_get_ui( rhs.mpz ); *lhs = val; return val; }
+static inline Int ?=?( Int * lhs, Int rhs ) { mpz_set( lhs->mpz, rhs.mpz ); return *lhs; }
+static inline Int ?=?( Int * lhs, long int rhs ) { mpz_set_si( lhs->mpz, rhs ); return *lhs; }
+static inline Int ?=?( Int * lhs, unsigned long int rhs ) { mpz_set_ui( lhs->mpz, rhs ); return *lhs; }
+static inline Int ?=?( Int * lhs, const char * rhs ) { if ( mpz_set_str( lhs->mpz, rhs, 0 ) ) { printf( "invalid string conversion\n" ); abort(); } return *lhs; }
+
+static inline char ?=?( char * lhs, Int rhs ) { char val = mpz_get_si( rhs.mpz ); *lhs = val; return val; }
+static inline short int ?=?( short int * lhs, Int rhs ) { short int val = mpz_get_si( rhs.mpz ); *lhs = val; return val; }
+static inline int ?=?( int * lhs, Int rhs ) { int val = mpz_get_si( rhs.mpz ); *lhs = val; return val; }
+static inline long int ?=?( long int * lhs, Int rhs ) { long int val = mpz_get_si( rhs.mpz ); *lhs = val; return val; }
+static inline unsigned char ?=?( unsigned char * lhs, Int rhs ) { unsigned char val = mpz_get_ui( rhs.mpz ); *lhs = val; return val; }
+static inline unsigned short int ?=?( unsigned short int * lhs, Int rhs ) { unsigned short int val = mpz_get_ui( rhs.mpz ); *lhs = val; return val; }
+static inline unsigned int ?=?( unsigned int * lhs, Int rhs ) { unsigned int val = mpz_get_ui( rhs.mpz ); *lhs = val; return val; }
+static inline unsigned long int ?=?( unsigned long int * lhs, Int rhs ) { unsigned long int val = mpz_get_ui( rhs.mpz ); *lhs = val; return val; }
 
 // conversions
-long int narrow( Int val ) { return mpz_get_si( val.mpz ); }
-unsigned long int narrow( Int val ) { return mpz_get_ui( val.mpz ); }
+static inline long int narrow( Int val ) { return mpz_get_si( val.mpz ); }
+static inline unsigned long int narrow( Int val ) { return mpz_get_ui( val.mpz ); }
 
 // comparison
-int ?==?( Int oper1, Int oper2 ) { return mpz_cmp( oper1.mpz, oper2.mpz ) == 0; }
-int ?==?( Int oper1, long int oper2 ) { return mpz_cmp_si( oper1.mpz, oper2 ) == 0; }
-int ?==?( long int oper2, Int oper1 ) { return mpz_cmp_si( oper1.mpz, oper2 ) == 0; }
-int ?==?( Int oper1, unsigned long int oper2 ) { return mpz_cmp_ui( oper1.mpz, oper2 ) == 0; }
-int ?==?( unsigned long int oper2, Int oper1 ) { return mpz_cmp_ui( oper1.mpz, oper2 ) == 0; }
-
-int ?!=?( Int oper1, Int oper2 ) { return ! ( oper1 == oper2 ); }
-int ?!=?( Int oper1, long int oper2 ) { return ! ( oper1 == oper2 ); }
-int ?!=?( long int oper1, Int oper2 ) { return ! ( oper1 == oper2 ); }
-int ?!=?( Int oper1, unsigned long int oper2 ) { return ! ( oper1 == oper2 ); }
-int ?!=?( unsigned long int oper1, Int oper2 ) { return ! ( oper1 == oper2 ); }
-
-int ?<?( Int oper1, Int oper2 ) { return mpz_cmp( oper1.mpz, oper2.mpz ) < 0; }
-int ?<?( Int oper1, long int oper2 ) { return mpz_cmp_si( oper1.mpz, oper2 ) < 0; }
-int ?<?( long int oper2, Int oper1 ) { return mpz_cmp_si( oper1.mpz, oper2 ) < 0; }
-int ?<?( Int oper1, unsigned long int oper2 ) { return mpz_cmp_ui( oper1.mpz, oper2 ) < 0; }
-int ?<?( unsigned long int oper2, Int oper1 ) { return mpz_cmp_ui( oper1.mpz, oper2 ) < 0; }
-
-int ?<=?( Int oper1, Int oper2 ) { return mpz_cmp( oper1.mpz, oper2.mpz ) <= 0; }
-int ?<=?( Int oper1, long int oper2 ) { return mpz_cmp_si( oper1.mpz, oper2 ) <= 0; }
-int ?<=?( long int oper2, Int oper1 ) { return mpz_cmp_si( oper1.mpz, oper2 ) <= 0; }
-int ?<=?( Int oper1, unsigned long int oper2 ) { return mpz_cmp_ui( oper1.mpz, oper2 ) <= 0; }
-int ?<=?( unsigned long int oper2, Int oper1 ) { return mpz_cmp_ui( oper1.mpz, oper2 ) <= 0; }
-
-int ?>?( Int oper1, Int oper2 ) { return ! ( oper1 <= oper2 ); }
-int ?>?( Int oper1, long int oper2 ) { return ! ( oper1 <= oper2 ); }
-int ?>?( long int oper1, Int oper2 ) { return ! ( oper1 <= oper2 ); }
-int ?>?( Int oper1, unsigned long int oper2 ) { return ! ( oper1 <= oper2 ); }
-int ?>?( unsigned long int oper1, Int oper2 ) { return ! ( oper1 <= oper2 ); }
-
-int ?>=?( Int oper1, Int oper2 ) { return ! ( oper1 < oper2 ); }
-int ?>=?( Int oper1, long int oper2 ) { return ! ( oper1 < oper2 ); }
-int ?>=?( long int oper1, Int oper2 ) { return ! ( oper1 < oper2 ); }
-int ?>=?( Int oper1, unsigned long int oper2 ) { return ! ( oper1 < oper2 ); }
-int ?>=?( unsigned long int oper1, Int oper2 ) { return ! ( oper1 < oper2 ); }
+static inline int ?==?( Int oper1, Int oper2 ) { return mpz_cmp( oper1.mpz, oper2.mpz ) == 0; }
+static inline int ?==?( Int oper1, long int oper2 ) { return mpz_cmp_si( oper1.mpz, oper2 ) == 0; }
+static inline int ?==?( long int oper2, Int oper1 ) { return mpz_cmp_si( oper1.mpz, oper2 ) == 0; }
+static inline int ?==?( Int oper1, unsigned long int oper2 ) { return mpz_cmp_ui( oper1.mpz, oper2 ) == 0; }
+static inline int ?==?( unsigned long int oper2, Int oper1 ) { return mpz_cmp_ui( oper1.mpz, oper2 ) == 0; }
+
+static inline int ?!=?( Int oper1, Int oper2 ) { return ! ( oper1 == oper2 ); }
+static inline int ?!=?( Int oper1, long int oper2 ) { return ! ( oper1 == oper2 ); }
+static inline int ?!=?( long int oper1, Int oper2 ) { return ! ( oper1 == oper2 ); }
+static inline int ?!=?( Int oper1, unsigned long int oper2 ) { return ! ( oper1 == oper2 ); }
+static inline int ?!=?( unsigned long int oper1, Int oper2 ) { return ! ( oper1 == oper2 ); }
+
+static inline int ?<?( Int oper1, Int oper2 ) { return mpz_cmp( oper1.mpz, oper2.mpz ) < 0; }
+static inline int ?<?( Int oper1, long int oper2 ) { return mpz_cmp_si( oper1.mpz, oper2 ) < 0; }
+static inline int ?<?( long int oper2, Int oper1 ) { return mpz_cmp_si( oper1.mpz, oper2 ) < 0; }
+static inline int ?<?( Int oper1, unsigned long int oper2 ) { return mpz_cmp_ui( oper1.mpz, oper2 ) < 0; }
+static inline int ?<?( unsigned long int oper2, Int oper1 ) { return mpz_cmp_ui( oper1.mpz, oper2 ) < 0; }
+
+static inline int ?<=?( Int oper1, Int oper2 ) { return mpz_cmp( oper1.mpz, oper2.mpz ) <= 0; }
+static inline int ?<=?( Int oper1, long int oper2 ) { return mpz_cmp_si( oper1.mpz, oper2 ) <= 0; }
+static inline int ?<=?( long int oper2, Int oper1 ) { return mpz_cmp_si( oper1.mpz, oper2 ) <= 0; }
+static inline int ?<=?( Int oper1, unsigned long int oper2 ) { return mpz_cmp_ui( oper1.mpz, oper2 ) <= 0; }
+static inline int ?<=?( unsigned long int oper2, Int oper1 ) { return mpz_cmp_ui( oper1.mpz, oper2 ) <= 0; }
+
+static inline int ?>?( Int oper1, Int oper2 ) { return ! ( oper1 <= oper2 ); }
+static inline int ?>?( Int oper1, long int oper2 ) { return ! ( oper1 <= oper2 ); }
+static inline int ?>?( long int oper1, Int oper2 ) { return ! ( oper1 <= oper2 ); }
+static inline int ?>?( Int oper1, unsigned long int oper2 ) { return ! ( oper1 <= oper2 ); }
+static inline int ?>?( unsigned long int oper1, Int oper2 ) { return ! ( oper1 <= oper2 ); }
+
+static inline int ?>=?( Int oper1, Int oper2 ) { return ! ( oper1 < oper2 ); }
+static inline int ?>=?( Int oper1, long int oper2 ) { return ! ( oper1 < oper2 ); }
+static inline int ?>=?( long int oper1, Int oper2 ) { return ! ( oper1 < oper2 ); }
+static inline int ?>=?( Int oper1, unsigned long int oper2 ) { return ! ( oper1 < oper2 ); }
+static inline int ?>=?( unsigned long int oper1, Int oper2 ) { return ! ( oper1 < oper2 ); }
 
 // arithmetic
-Int +?( Int oper ) { Int pos; mpz_set( pos.mpz, oper.mpz ); return pos; }
-Int -?( Int oper ) { Int neg; mpz_neg( neg.mpz, oper.mpz ); return neg; }
-Int ~?( Int oper ) { Int comp; mpz_com( comp.mpz, oper.mpz ); return comp; }
-
-Int ?&?( Int oper1, Int oper2 ) { Int conjunction; mpz_and( conjunction.mpz, oper1.mpz, oper2.mpz ); return conjunction; }
-Int ?&?( Int oper1, long int oper2 ) { Int conjunction, temp; mpz_set_si( temp.mpz, oper2 ); mpz_and( conjunction.mpz, oper1.mpz, temp.mpz ); return conjunction; }
-Int ?&?( long int oper1, Int oper2 ) { Int conjunction, temp; mpz_set_si( temp.mpz, oper1 ); mpz_and( conjunction.mpz, temp.mpz, oper2.mpz ); return conjunction; }
-Int ?&?( Int oper1, unsigned long int oper2 ) { Int conjunction, temp; mpz_set_ui( temp.mpz, oper2 ); mpz_and( conjunction.mpz, oper1.mpz, temp.mpz ); return conjunction; }
-Int ?&?( unsigned long int oper1, Int oper2 ) { Int conjunction, temp; mpz_set_ui( temp.mpz, oper1 ); mpz_and( conjunction.mpz, temp.mpz, oper2.mpz ); return conjunction; }
-Int ?&=?( Int * lhs, Int rhs ) { return *lhs = *lhs & rhs; }
-
-Int ?|?( Int oper1, Int oper2 ) { Int disjunction; mpz_ior( disjunction.mpz, oper1.mpz, oper2.mpz ); return disjunction; }
-Int ?|?( Int oper1, long int oper2 ) { Int disjunction, temp; mpz_set_si( temp.mpz, oper2 ); mpz_ior( disjunction.mpz, oper1.mpz, temp.mpz ); return disjunction; }
-Int ?|?( long int oper1, Int oper2 ) { Int disjunction, temp; mpz_set_si( temp.mpz, oper1 ); mpz_ior( disjunction.mpz, temp.mpz, oper2.mpz ); return disjunction; }
-Int ?|?( Int oper1, unsigned long int oper2 ) { Int disjunction, temp; mpz_set_ui( temp.mpz, oper2 ); mpz_ior( disjunction.mpz, oper1.mpz, temp.mpz ); return disjunction; }
-Int ?|?( unsigned long int oper1, Int oper2 ) { Int disjunction, temp; mpz_set_ui( temp.mpz, oper1 ); mpz_ior( disjunction.mpz, temp.mpz, oper2.mpz ); return disjunction; }
-Int ?|=?( Int * lhs, Int rhs ) { return *lhs = *lhs | rhs; }
-
-Int ?^?( Int oper1, Int oper2 ) { Int disjunction; mpz_xor( disjunction.mpz, oper1.mpz, oper2.mpz ); return disjunction; }
-Int ?^?( Int oper1, long int oper2 ) { Int disjunction, temp; mpz_set_si( temp.mpz, oper2 ); mpz_ior( disjunction.mpz, oper1.mpz, temp.mpz ); return disjunction; }
-Int ?^?( long int oper1, Int oper2 ) { Int disjunction, temp; mpz_set_si( temp.mpz, oper1 ); mpz_ior( disjunction.mpz, temp.mpz, oper2.mpz ); return disjunction; }
-Int ?^?( Int oper1, unsigned long int oper2 ) { Int disjunction, temp; mpz_set_ui( temp.mpz, oper2 ); mpz_ior( disjunction.mpz, oper1.mpz, temp.mpz ); return disjunction; }
-Int ?^?( unsigned long int oper1, Int oper2 ) { Int disjunction, temp; mpz_set_ui( temp.mpz, oper1 ); mpz_ior( disjunction.mpz, temp.mpz, oper2.mpz ); return disjunction; }
-Int ?^=?( Int * lhs, Int rhs ) { return *lhs = *lhs ^ rhs; }
-
-Int ?+?( Int addend1, Int addend2 ) { Int sum; mpz_add( sum.mpz, addend1.mpz, addend2.mpz ); return sum; }
-Int ?+?( Int addend1, long int addend2 ) { Int sum; if ( addend2 >= 0 ) mpz_add_ui( sum.mpz, addend1.mpz, addend2 ); else mpz_sub_ui( sum.mpz, addend1.mpz, -addend2 ); return sum; }
-Int ?+?( long int addend2, Int addend1 ) { Int sum; if ( addend2 >= 0 ) mpz_add_ui( sum.mpz, addend1.mpz, addend2 ); else mpz_sub_ui( sum.mpz, addend1.mpz, -addend2 ); return sum; }
-Int ?+?( Int addend1, unsigned long int addend2 ) { Int sum; mpz_add_ui( sum.mpz, addend1.mpz, addend2 ); return sum; }
-Int ?+?( unsigned long int addend2, Int addend1 ) { Int sum; mpz_add_ui( sum.mpz, addend1.mpz, addend2 ); return sum; }
-Int ?+=?( Int * lhs, Int rhs ) { return *lhs = *lhs + rhs; }
-Int ?+=?( Int * lhs, long int rhs ) { return *lhs = *lhs + rhs; }
-Int ?+=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs + rhs; }
-Int ++?( Int * lhs ) { return *lhs += 1; }
-Int ?++( Int * lhs ) { Int ret = *lhs; *lhs += 1; return ret; }
-
-Int ?-?( Int minuend, Int subtrahend ) { Int diff; mpz_sub( diff.mpz, minuend.mpz, subtrahend.mpz ); return diff; }
-Int ?-?( Int minuend, long int subtrahend ) { Int diff; if ( subtrahend >= 0 ) mpz_sub_ui( diff.mpz, minuend.mpz, subtrahend ); else mpz_add_ui( diff.mpz, minuend.mpz, -subtrahend ); return diff; }
-Int ?-?( long int minuend, Int subtrahend ) { Int diff; if ( subtrahend >= 0 ) mpz_ui_sub( diff.mpz, minuend, subtrahend.mpz ); else { mpz_add_ui( diff.mpz, subtrahend.mpz, -minuend ); mpz_neg( diff.mpz, diff.mpz ); } return diff; }
-Int ?-?( Int minuend, unsigned long int subtrahend ) { Int diff; mpz_sub_ui( diff.mpz, minuend.mpz, subtrahend ); return diff; }
-Int ?-?( unsigned long int minuend, Int subtrahend ) { Int diff; mpz_ui_sub( diff.mpz, minuend, subtrahend.mpz ); return diff; }
-Int ?-=?( Int * lhs, Int rhs ) { return *lhs = *lhs - rhs; }
-Int ?-=?( Int * lhs, long int rhs ) { return *lhs = *lhs - rhs; }
-Int ?-=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs - rhs; }
-Int --?( Int * lhs ) { return *lhs -= 1; }
-Int ?--( Int * lhs ) { Int ret = *lhs; *lhs -= 1; return ret; }
-
-Int ?*?( Int multiplicator, Int multiplicand ) { Int product; mpz_mul( product.mpz, multiplicator.mpz, multiplicand.mpz ); return product; }
-Int ?*?( Int multiplicator, long int multiplicand ) { Int product; mpz_mul_si( product.mpz, multiplicator.mpz, multiplicand ); return product; }
-Int ?*?( long int multiplicand, Int multiplicator ) { Int product; mpz_mul_si( product.mpz, multiplicator.mpz, multiplicand ); return product; }
-Int ?*?( Int multiplicator, unsigned long int multiplicand ) { Int product; mpz_mul_ui( product.mpz, multiplicator.mpz, multiplicand ); return product; }
-Int ?*?( unsigned long int multiplicand, Int multiplicator ) { Int product; mpz_mul_ui( product.mpz, multiplicator.mpz, multiplicand ); return product; }
-Int ?*=?( Int * lhs, Int rhs ) { return *lhs = *lhs * rhs; }
-Int ?*=?( Int * lhs, long int rhs ) { return *lhs = *lhs * rhs; }
-Int ?*=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs * rhs; }
+static inline Int +?( Int oper ) { Int pos; mpz_set( pos.mpz, oper.mpz ); return pos; }
+static inline Int -?( Int oper ) { Int neg; mpz_neg( neg.mpz, oper.mpz ); return neg; }
+static inline Int ~?( Int oper ) { Int comp; mpz_com( comp.mpz, oper.mpz ); return comp; }
+
+static inline Int ?&?( Int oper1, Int oper2 ) { Int conjunction; mpz_and( conjunction.mpz, oper1.mpz, oper2.mpz ); return conjunction; }
+static inline Int ?&?( Int oper1, long int oper2 ) { Int conjunction, temp; mpz_set_si( temp.mpz, oper2 ); mpz_and( conjunction.mpz, oper1.mpz, temp.mpz ); return conjunction; }
+static inline Int ?&?( long int oper1, Int oper2 ) { Int conjunction, temp; mpz_set_si( temp.mpz, oper1 ); mpz_and( conjunction.mpz, temp.mpz, oper2.mpz ); return conjunction; }
+static inline Int ?&?( Int oper1, unsigned long int oper2 ) { Int conjunction, temp; mpz_set_ui( temp.mpz, oper2 ); mpz_and( conjunction.mpz, oper1.mpz, temp.mpz ); return conjunction; }
+static inline Int ?&?( unsigned long int oper1, Int oper2 ) { Int conjunction, temp; mpz_set_ui( temp.mpz, oper1 ); mpz_and( conjunction.mpz, temp.mpz, oper2.mpz ); return conjunction; }
+static inline Int ?&=?( Int * lhs, Int rhs ) { return *lhs = *lhs & rhs; }
+
+static inline Int ?|?( Int oper1, Int oper2 ) { Int disjunction; mpz_ior( disjunction.mpz, oper1.mpz, oper2.mpz ); return disjunction; }
+static inline Int ?|?( Int oper1, long int oper2 ) { Int disjunction, temp; mpz_set_si( temp.mpz, oper2 ); mpz_ior( disjunction.mpz, oper1.mpz, temp.mpz ); return disjunction; }
+static inline Int ?|?( long int oper1, Int oper2 ) { Int disjunction, temp; mpz_set_si( temp.mpz, oper1 ); mpz_ior( disjunction.mpz, temp.mpz, oper2.mpz ); return disjunction; }
+static inline Int ?|?( Int oper1, unsigned long int oper2 ) { Int disjunction, temp; mpz_set_ui( temp.mpz, oper2 ); mpz_ior( disjunction.mpz, oper1.mpz, temp.mpz ); return disjunction; }
+static inline Int ?|?( unsigned long int oper1, Int oper2 ) { Int disjunction, temp; mpz_set_ui( temp.mpz, oper1 ); mpz_ior( disjunction.mpz, temp.mpz, oper2.mpz ); return disjunction; }
+static inline Int ?|=?( Int * lhs, Int rhs ) { return *lhs = *lhs | rhs; }
+
+static inline Int ?^?( Int oper1, Int oper2 ) { Int disjunction; mpz_xor( disjunction.mpz, oper1.mpz, oper2.mpz ); return disjunction; }
+static inline Int ?^?( Int oper1, long int oper2 ) { Int disjunction, temp; mpz_set_si( temp.mpz, oper2 ); mpz_ior( disjunction.mpz, oper1.mpz, temp.mpz ); return disjunction; }
+static inline Int ?^?( long int oper1, Int oper2 ) { Int disjunction, temp; mpz_set_si( temp.mpz, oper1 ); mpz_ior( disjunction.mpz, temp.mpz, oper2.mpz ); return disjunction; }
+static inline Int ?^?( Int oper1, unsigned long int oper2 ) { Int disjunction, temp; mpz_set_ui( temp.mpz, oper2 ); mpz_ior( disjunction.mpz, oper1.mpz, temp.mpz ); return disjunction; }
+static inline Int ?^?( unsigned long int oper1, Int oper2 ) { Int disjunction, temp; mpz_set_ui( temp.mpz, oper1 ); mpz_ior( disjunction.mpz, temp.mpz, oper2.mpz ); return disjunction; }
+static inline Int ?^=?( Int * lhs, Int rhs ) { return *lhs = *lhs ^ rhs; }
+
+static inline Int ?+?( Int addend1, Int addend2 ) { Int sum; mpz_add( sum.mpz, addend1.mpz, addend2.mpz ); return sum; }
+static inline Int ?+?( Int addend1, long int addend2 ) { Int sum; if ( addend2 >= 0 ) mpz_add_ui( sum.mpz, addend1.mpz, addend2 ); else mpz_sub_ui( sum.mpz, addend1.mpz, -addend2 ); return sum; }
+static inline Int ?+?( long int addend2, Int addend1 ) { Int sum; if ( addend2 >= 0 ) mpz_add_ui( sum.mpz, addend1.mpz, addend2 ); else mpz_sub_ui( sum.mpz, addend1.mpz, -addend2 ); return sum; }
+static inline Int ?+?( Int addend1, unsigned long int addend2 ) { Int sum; mpz_add_ui( sum.mpz, addend1.mpz, addend2 ); return sum; }
+static inline Int ?+?( unsigned long int addend2, Int addend1 ) { Int sum; mpz_add_ui( sum.mpz, addend1.mpz, addend2 ); return sum; }
+static inline Int ?+=?( Int * lhs, Int rhs ) { return *lhs = *lhs + rhs; }
+static inline Int ?+=?( Int * lhs, long int rhs ) { return *lhs = *lhs + rhs; }
+static inline Int ?+=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs + rhs; }
+static inline Int ++?( Int * lhs ) { return *lhs += 1; }
+static inline Int ?++( Int * lhs ) { Int ret = *lhs; *lhs += 1; return ret; }
+
+static inline Int ?-?( Int minuend, Int subtrahend ) { Int diff; mpz_sub( diff.mpz, minuend.mpz, subtrahend.mpz ); return diff; }
+static inline Int ?-?( Int minuend, long int subtrahend ) { Int diff; if ( subtrahend >= 0 ) mpz_sub_ui( diff.mpz, minuend.mpz, subtrahend ); else mpz_add_ui( diff.mpz, minuend.mpz, -subtrahend ); return diff; }
+static inline Int ?-?( long int minuend, Int subtrahend ) { Int diff; if ( subtrahend >= 0 ) mpz_ui_sub( diff.mpz, minuend, subtrahend.mpz ); else { mpz_add_ui( diff.mpz, subtrahend.mpz, -minuend ); mpz_neg( diff.mpz, diff.mpz ); } return diff; }
+static inline Int ?-?( Int minuend, unsigned long int subtrahend ) { Int diff; mpz_sub_ui( diff.mpz, minuend.mpz, subtrahend ); return diff; }
+static inline Int ?-?( unsigned long int minuend, Int subtrahend ) { Int diff; mpz_ui_sub( diff.mpz, minuend, subtrahend.mpz ); return diff; }
+static inline Int ?-=?( Int * lhs, Int rhs ) { return *lhs = *lhs - rhs; }
+static inline Int ?-=?( Int * lhs, long int rhs ) { return *lhs = *lhs - rhs; }
+static inline Int ?-=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs - rhs; }
+static inline Int --?( Int * lhs ) { return *lhs -= 1; }
+static inline Int ?--( Int * lhs ) { Int ret = *lhs; *lhs -= 1; return ret; }
+
+static inline Int ?*?( Int multiplicator, Int multiplicand ) { Int product; mpz_mul( product.mpz, multiplicator.mpz, multiplicand.mpz ); return product; }
+static inline Int ?*?( Int multiplicator, long int multiplicand ) { Int product; mpz_mul_si( product.mpz, multiplicator.mpz, multiplicand ); return product; }
+static inline Int ?*?( long int multiplicand, Int multiplicator ) { Int product; mpz_mul_si( product.mpz, multiplicator.mpz, multiplicand ); return product; }
+static inline Int ?*?( Int multiplicator, unsigned long int multiplicand ) { Int product; mpz_mul_ui( product.mpz, multiplicator.mpz, multiplicand ); return product; }
+static inline Int ?*?( unsigned long int multiplicand, Int multiplicator ) { Int product; mpz_mul_ui( product.mpz, multiplicator.mpz, multiplicand ); return product; }
+static inline Int ?*=?( Int * lhs, Int rhs ) { return *lhs = *lhs * rhs; }
+static inline Int ?*=?( Int * lhs, long int rhs ) { return *lhs = *lhs * rhs; }
+static inline Int ?*=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs * rhs; }
 
 // some code for operators "/" and "%" taken from g++ gmpxx.h
-Int ?/?( Int dividend, Int divisor ) { Int quotient; mpz_tdiv_q( quotient.mpz, dividend.mpz, divisor.mpz ); return quotient; }
-Int ?/?( Int dividend, unsigned long int divisor ) { Int quotient; mpz_tdiv_q_ui( quotient.mpz, dividend.mpz, divisor ); return quotient; }
-Int ?/?( unsigned long int dividend, Int divisor ) {
+static inline Int ?/?( Int dividend, Int divisor ) { Int quotient; mpz_tdiv_q( quotient.mpz, dividend.mpz, divisor.mpz ); return quotient; }
+static inline Int ?/?( Int dividend, unsigned long int divisor ) { Int quotient; mpz_tdiv_q_ui( quotient.mpz, dividend.mpz, divisor ); return quotient; }
+static inline Int ?/?( unsigned long int dividend, Int divisor ) {
 	Int quotient;
     if ( mpz_sgn( divisor.mpz ) >= 0 ) {
@@ -164,5 +164,5 @@
 	return quotient;
 } // ?/?
-Int ?/?( Int dividend, long int divisor ) {
+static inline Int ?/?( Int dividend, long int divisor ) {
 	Int quotient;
     if ( divisor >= 0 )
@@ -174,5 +174,5 @@
 	return quotient;
 } // ?/?
-Int ?/?( long int dividend, Int divisor ) {
+static inline Int ?/?( long int dividend, Int divisor ) {
 	Int quotient;
     if ( mpz_fits_slong_p( divisor.mpz ) )
@@ -185,14 +185,14 @@
 	return quotient;
 } // ?/?
-Int ?/=?( Int * lhs, Int rhs ) { return *lhs = *lhs / rhs; }
-Int ?/=?( Int * lhs, long int rhs ) { return *lhs = *lhs / rhs; }
-Int ?/=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs / rhs; }
-
-[ Int, Int ] div( Int dividend, Int divisor ) { Int quotient, remainder; mpz_fdiv_qr( quotient.mpz, remainder.mpz, dividend.mpz, divisor.mpz ); return [ quotient, remainder ]; }
-[ Int, Int ] div( Int dividend, unsigned long int divisor ) { Int quotient, remainder; mpz_fdiv_qr_ui( quotient.mpz, remainder.mpz, dividend.mpz, divisor ); return [ quotient, remainder ]; }
-
-Int ?%?( Int dividend, Int divisor ) { Int remainder; mpz_tdiv_r( remainder.mpz, dividend.mpz, divisor.mpz ); return remainder; }
-Int ?%?( Int dividend, unsigned long int divisor ) { Int remainder; mpz_tdiv_r_ui( remainder.mpz, dividend.mpz, divisor ); return remainder; }
-Int ?%?( unsigned long int dividend, Int divisor ) {
+static inline Int ?/=?( Int * lhs, Int rhs ) { return *lhs = *lhs / rhs; }
+static inline Int ?/=?( Int * lhs, long int rhs ) { return *lhs = *lhs / rhs; }
+static inline Int ?/=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs / rhs; }
+
+static inline [ Int, Int ] div( Int dividend, Int divisor ) { Int quotient, remainder; mpz_fdiv_qr( quotient.mpz, remainder.mpz, dividend.mpz, divisor.mpz ); return [ quotient, remainder ]; }
+static inline [ Int, Int ] div( Int dividend, unsigned long int divisor ) { Int quotient, remainder; mpz_fdiv_qr_ui( quotient.mpz, remainder.mpz, dividend.mpz, divisor ); return [ quotient, remainder ]; }
+
+static inline Int ?%?( Int dividend, Int divisor ) { Int remainder; mpz_tdiv_r( remainder.mpz, dividend.mpz, divisor.mpz ); return remainder; }
+static inline Int ?%?( Int dividend, unsigned long int divisor ) { Int remainder; mpz_tdiv_r_ui( remainder.mpz, dividend.mpz, divisor ); return remainder; }
+static inline Int ?%?( unsigned long int dividend, Int divisor ) {
 	Int remainder;
     if ( mpz_sgn( divisor.mpz ) >= 0 ) {
@@ -210,10 +210,10 @@
 	return remainder;
 } // ?%?
-Int ?%?( Int dividend, long int divisor ) {
+static inline Int ?%?( Int dividend, long int divisor ) {
 	Int remainder;
     mpz_tdiv_r_ui( remainder.mpz, dividend.mpz, (divisor >= 0 ? divisor : -divisor));
 	return remainder;
 } // ?%?
-Int ?%?( long int dividend, Int divisor ) {
+static inline Int ?%?( long int dividend, Int divisor ) {
 	Int remainder;
     if ( mpz_fits_slong_p( divisor.mpz ) )
@@ -226,28 +226,28 @@
 	return remainder;
 } // ?%?
-Int ?%=?( Int * lhs, Int rhs ) { return *lhs = *lhs % rhs; }
-Int ?%=?( Int * lhs, long int rhs ) { return *lhs = *lhs % rhs; }
-Int ?%=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs % rhs; }
-
-Int ?<<?( Int shiften, mp_bitcnt_t shift ) { Int shifted; mpz_mul_2exp( shifted.mpz, shiften.mpz, shift ); return shifted; }
-Int ?<<=?( Int * lhs, mp_bitcnt_t shift ) { return *lhs = *lhs << shift; }
-Int ?>>?( Int shiften, mp_bitcnt_t shift ) { Int shifted; mpz_fdiv_q_2exp( shifted.mpz, shiften.mpz, shift ); return shifted; }
-Int ?>>=?( Int * lhs, mp_bitcnt_t shift ) { return *lhs = *lhs >> shift; }
+static inline Int ?%=?( Int * lhs, Int rhs ) { return *lhs = *lhs % rhs; }
+static inline Int ?%=?( Int * lhs, long int rhs ) { return *lhs = *lhs % rhs; }
+static inline Int ?%=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs % rhs; }
+
+static inline Int ?<<?( Int shiften, mp_bitcnt_t shift ) { Int shifted; mpz_mul_2exp( shifted.mpz, shiften.mpz, shift ); return shifted; }
+static inline Int ?<<=?( Int * lhs, mp_bitcnt_t shift ) { return *lhs = *lhs << shift; }
+static inline Int ?>>?( Int shiften, mp_bitcnt_t shift ) { Int shifted; mpz_fdiv_q_2exp( shifted.mpz, shiften.mpz, shift ); return shifted; }
+static inline Int ?>>=?( Int * lhs, mp_bitcnt_t shift ) { return *lhs = *lhs >> shift; }
 
 // number functions
-Int abs( Int oper ) { Int positive; mpz_abs( positive.mpz, oper.mpz ); return positive; }
-Int fact( unsigned long int N ) { Int factorial; mpz_fac_ui( factorial.mpz, N ); return factorial; }
-Int gcd( Int oper1, Int oper2 ) { Int gcdret; mpz_gcd( gcdret.mpz, oper1.mpz, oper2.mpz ); return gcdret; }
-Int pow( Int base, unsigned long int exponent ) { Int power; mpz_pow_ui( power.mpz, base.mpz, exponent ); return power; }
-Int pow( unsigned long int base, unsigned long int exponent ) { Int power; mpz_ui_pow_ui( power.mpz, base, exponent ); return power; }
-void srandom( gmp_randstate_t state ) { gmp_randinit_default( state ); }
-Int random( gmp_randstate_t state, mp_bitcnt_t n ) { Int rand; mpz_urandomb( rand.mpz, state, n ); return rand; }
-Int random( gmp_randstate_t state, Int n ) { Int rand; mpz_urandomm( rand.mpz, state, n.mpz ); return rand; }
-Int random( gmp_randstate_t state, mp_size_t max_size ) { Int rand; mpz_random( rand.mpz, max_size ); return rand; }
-int sgn( Int oper ) { return mpz_sgn( oper.mpz ); }
-Int sqrt( Int oper ) { Int root; mpz_sqrt( root.mpz, oper.mpz ); return root; }
+static inline Int abs( Int oper ) { Int positive; mpz_abs( positive.mpz, oper.mpz ); return positive; }
+static inline Int fact( unsigned long int N ) { Int factorial; mpz_fac_ui( factorial.mpz, N ); return factorial; }
+static inline Int gcd( Int oper1, Int oper2 ) { Int gcdret; mpz_gcd( gcdret.mpz, oper1.mpz, oper2.mpz ); return gcdret; }
+static inline Int pow( Int base, unsigned long int exponent ) { Int power; mpz_pow_ui( power.mpz, base.mpz, exponent ); return power; }
+static inline Int pow( unsigned long int base, unsigned long int exponent ) { Int power; mpz_ui_pow_ui( power.mpz, base, exponent ); return power; }
+static inline void srandom( gmp_randstate_t state ) { gmp_randinit_default( state ); }
+static inline Int random( gmp_randstate_t state, mp_bitcnt_t n ) { Int rand; mpz_urandomb( rand.mpz, state, n ); return rand; }
+static inline Int random( gmp_randstate_t state, Int n ) { Int rand; mpz_urandomm( rand.mpz, state, n.mpz ); return rand; }
+static inline Int random( gmp_randstate_t state, mp_size_t max_size ) { Int rand; mpz_random( rand.mpz, max_size ); return rand; }
+static inline int sgn( Int oper ) { return mpz_sgn( oper.mpz ); }
+static inline Int sqrt( Int oper ) { Int root; mpz_sqrt( root.mpz, oper.mpz ); return root; }
 
 // I/O
-forall( dtype istype | istream( istype ) )
+static inline forall( dtype istype | istream( istype ) )
 istype * ?|?( istype * is, Int * mp ) {
  	gmp_scanf( "%Zd", mp );
@@ -255,5 +255,5 @@
 } // ?|?
 
-forall( dtype ostype | ostream( ostype ) )
+static inline forall( dtype ostype | ostream( ostype ) )
 ostype * ?|?( ostype * os, Int mp ) {
 	if ( sepPrt( os ) ) fmt( os, "%s", sepGetCur( os ) );
Index: src/libcfa/stdlib
===================================================================
--- src/libcfa/stdlib	(revision a0297141bb69876b96202a3ccbe63d79eea4c362)
+++ src/libcfa/stdlib	(revision 5e8d732708a3890c61f7eaff07bb0bffd32402cf)
@@ -10,6 +10,6 @@
 // Created On       : Thu Jan 28 17:12:35 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed May 24 18:06:27 2017
-// Update Count     : 115
+// Last Modified On : Tue May 30 09:07:35 2017
+// Update Count     : 164
 //
 
@@ -28,21 +28,116 @@
 //---------------------------------------
 
-forall( dtype T | sized(T) ) T * malloc( void );
-forall( dtype T | sized(T) ) T * malloc( char fill );
-forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size );
-forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size, unsigned char fill );
-extern "C" { void * calloc( size_t nmemb, size_t size ); } // use default C routine for void *
-forall( dtype T | sized(T) ) T * calloc( size_t nmemb );
+extern "C" { void * memset( void * dest, int c, size_t size ); } // use default C routine for void *
+
+// allocation, non-array types
+static inline forall( dtype T | sized(T) ) T * malloc( void ) {
+	//printf( "X1\n" );
+	return (T *)(void *)malloc( (size_t)sizeof(T) );	// C malloc
+} // malloc
+static inline forall( dtype T | sized(T) ) T * malloc( char fill ) {
+	//printf( "X2\n" );
+	T * ptr = (T *)(void *)malloc( (size_t)sizeof(T) );	// C malloc
+    return memset( ptr, (int)fill, sizeof(T) );			// initial with fill value
+} // malloc
+
+// allocation, array types
+extern "C" { void * calloc( size_t dim, size_t size ); } // use default C routine for void *
+static inline forall( dtype T | sized(T) ) T * calloc( size_t dim ) {
+	//printf( "X3\n" );
+	return (T *)(void *)calloc( dim, sizeof(T) );		// C cmalloc
+}
+static inline forall( dtype T | sized(T) ) T * amalloc( size_t dim ) { // alternative name
+	//printf( "X4\n" );
+	return (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C malloc
+} // amalloc
+static inline forall( dtype T | sized(T) ) T * amalloc( size_t dim, char fill ) { // alternative name
+	//printf( "X5\n" );
+	T * ptr = (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C malloc
+    return memset( ptr, (int)fill, dim * sizeof(T) );
+} // amalloc
+
+// resize, non-array types
 extern "C" { void * realloc( void * ptr, size_t size ); } // use default C routine for void *
-forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size );
-forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size, unsigned char fill );
-
-forall( dtype T | sized(T) ) T * aligned_alloc( size_t alignment );
-forall( dtype T | sized(T) ) T * memalign( size_t alignment );		// deprecated
-forall( dtype T | sized(T) ) int posix_memalign( T ** ptr, size_t alignment );
-
+static inline forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size ) {
+	//printf( "X5.5\n" );
+	return (T *)(void *)realloc( (void *)ptr, size );
+}
+forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size, char fill );
+static inline forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size ) {	// alternative name
+	//printf( "X7\n" );
+	return realloc( ptr, size );
+} // malloc
+static inline forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size, char fill ) { // alternative name
+	//printf( "X8\n" );
+	return realloc( ptr, size, fill );
+} // malloc
+
+// resize, array types
+static inline forall( dtype T | sized(T) ) T * amalloc( T * ptr, size_t dim ) {
+	//printf( "X9\n" );
+	return malloc( ptr, dim * (size_t)sizeof(T) );
+} // amalloc
+static inline forall( dtype T | sized(T) ) T * amalloc( T * ptr, size_t dim, char fill ) {
+	//printf( "X10\n" );
+	return malloc( ptr, dim * (size_t)sizeof(T), fill );
+} // amalloc
+
+// alignment, non-array types
+extern "C" { void * memalign( size_t alignment, size_t size ); } // use default C routine for void *
+static inline forall( dtype T | sized(T) ) T * memalign( size_t alignment ) {
+	//printf( "X11\n" );
+	return (T *)memalign( alignment, sizeof(T) );
+} // memalign
+static inline forall( dtype T | sized(T) ) T * memalign( size_t alignment, char fill ) {
+	//printf( "X12\n" );
+    T * ptr = (T *)memalign( alignment, sizeof(T) );
+    return memset( ptr, (int)fill, sizeof(T) );
+} // memalign
+static inline forall( dtype T | sized(T) ) T * aligned_alloc( size_t alignment ) {
+	//printf( "X13\n" );
+	return (T *)memalign( alignment, sizeof(T) );
+} // aligned_alloc
+extern "C" { int posix_memalign( void ** ptr, size_t alignment, size_t size ); } // use default C routine for void *
+static inline forall( dtype T | sized(T) ) int posix_memalign( T ** ptr, size_t alignment ) {
+	//printf( "X14\n" );
+	return posix_memalign( (void **)ptr, alignment, sizeof(T) );
+} // posix_memalign
+
+// alignment, array types
+static inline forall( dtype T | sized(T) ) T * amemalign( size_t alignment, size_t dim ) {
+	//printf( "X15\n" );
+	return (T *)memalign( alignment, dim * sizeof(T) );
+} // amemalign
+static inline forall( dtype T | sized(T) ) T * amemalign( size_t alignment, size_t dim, char fill ) {
+	//printf( "X16\n" );
+    T * ptr = (T *)memalign( alignment, dim * sizeof(T) );
+    return memset( ptr, (int)fill, dim * sizeof(T) );
+} // amemalign
+
+// data, non-array types
+static inline forall( dtype T | sized(T) ) T * memset( T * dest, char c ) {
+	//printf( "X17\n" );
+	return memset( dest, c, sizeof(T) );
+} // memset
+extern "C" { void * memcpy( void * dest, const void * src, size_t size ); } // use default C routine for void *
+static inline forall( dtype T | sized(T) ) T * memcpy( T * dest, const T * src ) {
+	//printf( "X18\n" );
+	return memcpy( dest, src, sizeof(T) );
+} // memcpy
+
+// data, array types
+static inline forall( dtype T | sized(T) ) T * amemset( T * dest, size_t dim, char c ) {
+	//printf( "X19\n" );
+	return memset( dest, c, dim * sizeof(T) );
+} // amemset
+static inline forall( dtype T | sized(T) ) T * amemcpy( T * dest, const T * src, size_t dim ) {
+	//printf( "X20\n" );
+	return memcpy( dest, src, dim * sizeof(T) );
+} // amemcpy
+
+// allocation/deallocation and constructor/destructor
 forall( dtype T, ttype Params | sized(T) | { void ?{}(T *, Params); } ) T * new( Params p );
-forall( dtype T | { void ^?{}(T *); } ) void delete( T * ptr );
-forall( dtype T, ttype Params | { void ^?{}(T *); void delete(Params); } ) void delete( T * ptr, Params rest );
+forall( dtype T | { void ^?{}( T * ); } ) void delete( T * ptr );
+forall( dtype T, ttype Params | { void ^?{}( T * ); void delete( Params ); } ) void delete( T * ptr, Params rest );
 
 //---------------------------------------
@@ -77,12 +172,12 @@
 
 forall( otype T | { int ?<?( T, T ); } )
-T * bsearch( T key, const T * arr, size_t dimension );
-
-forall( otype T | { int ?<?( T, T ); } )
-unsigned int bsearch( T key, const T * arr, size_t dimension );
-
-
-forall( otype T | { int ?<?( T, T ); } )
-void qsort( const T * arr, size_t dimension );
+T * bsearch( T key, const T * arr, size_t dim );
+
+forall( otype T | { int ?<?( T, T ); } )
+unsigned int bsearch( T key, const T * arr, size_t dim );
+
+
+forall( otype T | { int ?<?( T, T ); } )
+void qsort( const T * arr, size_t dim );
 
 //---------------------------------------
Index: src/libcfa/stdlib.c
===================================================================
--- src/libcfa/stdlib.c	(revision a0297141bb69876b96202a3ccbe63d79eea4c362)
+++ src/libcfa/stdlib.c	(revision 5e8d732708a3890c61f7eaff07bb0bffd32402cf)
@@ -10,6 +10,6 @@
 // Created On       : Thu Jan 28 17:10:29 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed May 24 18:13:15 2017
-// Update Count     : 198
+// Last Modified On : Tue May 30 09:07:56 2017
+// Update Count     : 237
 //
 
@@ -21,5 +21,5 @@
 #define _XOPEN_SOURCE 600								// posix_memalign, *rand48
 #include <stdlib.h>										// malloc, free, calloc, realloc, memalign, posix_memalign, bsearch
-#include <string.h>										// memset
+#include <string.h>										// memcpy, memset
 #include <malloc.h>										// malloc_usable_size
 #include <math.h>										// fabsf, fabs, fabsl
@@ -27,71 +27,36 @@
 } // extern "C"
 
-forall( dtype T | sized(T) ) T * malloc( void ) {		// type-safe
-    return (T *)(void *)malloc( (size_t)sizeof(T) );
-} // malloc
-
-forall( dtype T | sized(T) ) T * malloc( char fill ) {	// initial with fill value (like calloc)
-	T * ptr = (T *)(void *)malloc( (size_t)sizeof(T) );
-    return memset( ptr, (int)fill, sizeof(T) );
-} // malloc
-
-forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size ) { // alternative realloc
-    return (T *)realloc( ptr, size );
-} // malloc
-
-forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size, unsigned char fill ) { // alternative realloc with fill value
-    return (T *)realloc( ptr, size, fill );
-} // malloc
-
-
-forall( dtype T | sized(T) ) T * calloc( size_t nmemb ) { // type-safe array initialization with fill 0
-    return (T *)calloc( nmemb, sizeof(T) );
-} // calloc
-
-
-forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size ) { // type-safe
-    return (T *)(void *)realloc( (void *)ptr, size );
+// resize, non-array types
+forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size, char fill ) { // alternative realloc with fill value
+	//printf( "X6\n" );
+	size_t olen = malloc_usable_size( ptr );			// current allocation
+    char * nptr = (void *)realloc( (void *)ptr, size );	// C realloc
+	size_t nlen = malloc_usable_size( nptr );			// new allocation
+	if ( nlen > olen ) {								// larger ?
+		memset( nptr + olen, (int)fill, nlen - olen );	// initialize added storage
+	} // 
+    return (T *)nptr;
 } // realloc
 
-forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size, unsigned char fill ) { // alternative realloc with fill value
-    char * nptr = (T *)(void *)realloc( (void *)ptr, size );
-    size_t unused = malloc_usable_size( nptr );
-    memset( nptr + size - unused, (int)fill, unused );	// initialize any new storage
-    return nptr;
-} // realloc
-
-
-forall( dtype T | sized(T) ) T * aligned_alloc( size_t alignment ) { // aligned allocation
-    return (T *)memalign( alignment, sizeof(T) );
-} // aligned_alloc
-
-forall( dtype T | sized(T) ) T * memalign( size_t alignment ) {
-    return (T *)memalign( alignment, sizeof(T) );
-} // memalign
-
-forall( dtype T | sized(T) ) int posix_memalign( T ** ptr, size_t alignment ) {
-    return posix_memalign( (void **)ptr, alignment, sizeof(T) );
-} // posix_memalign
-
-
-forall( dtype T, ttype Params | sized(T) | { void ?{}( T *, Params ); } ) //  new
+// allocation/deallocation and constructor/destructor
+forall( dtype T, ttype Params | sized(T) | { void ?{}( T *, Params ); } )
 T * new( Params p ) {
 	return ((T *)malloc()){ p };
 } // new
 
-forall( dtype T | { void ^?{}(T *); } )					// delete
+forall( dtype T | { void ^?{}( T * ); } )
 void delete( T * ptr ) {
 	if ( ptr ) {
-		^ptr{};
+		^ptr{};											// run destructor
 		free( ptr );
-	}
+	} // if
 } // delete
 
-forall( dtype T, ttype Params | { void ^?{}(T *); void delete(Params); } )
+forall( dtype T, ttype Params | { void ^?{}( T * ); void delete( Params ); } )
 void delete( T * ptr, Params rest ) {
 	if ( ptr ) {
-		^ptr{};
+		^ptr{};											// run destructor
 		free( ptr );
-	}
+	} // if
 	delete( rest );
 } // delete
@@ -242,19 +207,19 @@
 
 forall( otype T | { int ?<?( T, T ); } )
-T * bsearch( T key, const T * arr, size_t dimension ) {
+T * bsearch( T key, const T * arr, size_t dim ) {
 	int comp( const void * t1, const void * t2 ) { return *(T *)t1 < *(T *)t2 ? -1 : *(T *)t2 < *(T *)t1 ? 1 : 0; }
-	return (T *)bsearch( &key, arr, dimension, sizeof(T), comp );
+	return (T *)bsearch( &key, arr, dim, sizeof(T), comp );
 } // bsearch
 
 forall( otype T | { int ?<?( T, T ); } )
-unsigned int bsearch( T key, const T * arr, size_t dimension ) {
-	T *result = bsearch( key, arr, dimension );
-	return result ? result - arr : dimension;			// pointer subtraction includes sizeof(T)
+unsigned int bsearch( T key, const T * arr, size_t dim ) {
+	T *result = bsearch( key, arr, dim );
+	return result ? result - arr : dim;					// pointer subtraction includes sizeof(T)
 } // bsearch
 
 forall( otype T | { int ?<?( T, T ); } )
-void qsort( const T * arr, size_t dimension ) {
+void qsort( const T * arr, size_t dim ) {
 	int comp( const void * t1, const void * t2 ) { return *(T *)t1 < *(T *)t2 ? -1 : *(T *)t2 < *(T *)t1 ? 1 : 0; }
-	qsort( arr, dimension, sizeof(T), comp );
+	qsort( arr, dim, sizeof(T), comp );
 } // qsort
 
Index: src/tests/.expect/alloc.txt
===================================================================
--- src/tests/.expect/alloc.txt	(revision 5e8d732708a3890c61f7eaff07bb0bffd32402cf)
+++ src/tests/.expect/alloc.txt	(revision 5e8d732708a3890c61f7eaff07bb0bffd32402cf)
@@ -0,0 +1,56 @@
+C   malloc deadbeef
+CFA malloc 0
+CFA malloc, fill 01010101
+
+C   calloc
+0 0 0 0 0 0 0 0 0 0 
+CFA calloc
+0 0 0 0 0 0 0 0 0 0 
+CFA array malloc
+0 0 deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef 
+CFA array malloc
+1010101 1010101 1010101 1010101 1010101 1010101 1010101 1010101 1010101 1010101 1010101 1010101 1010101 1010101 1010101 1010101 1010101 1010101 1010101 1010101 
+
+C   realloc
+deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef 
+CFA realloc
+deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef 0 0 0 0 0 0 0 0 0 0 
+CFA realloc
+deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef 
+CFA resize malloc
+deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef 
+CFA resize malloc, fill
+deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef 1010101 1010101 1010101 1010101 1010101 1010101 1010101 1010101 1010101 1010101 
+CFA resize malloc, fill
+deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef 
+
+CFA resize array malloc
+deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef 0 0 0 0 0 0 0 0 0 0 
+CFA resize array malloc
+deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef 
+CFA resize array malloc, fill
+deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef 1010101 1010101 1010101 1010101 1010101 1010101 1010101 1010101 1010101 1010101 
+CFA resize array malloc, fill
+deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef deadbeef 
+
+CFA aligned_alloc 42 42.5
+CFA memalign 42 42.5
+CFA posix_memalign 42 42.5
+CFA memalign fill 16843009 7.7486e-304
+
+CFA memalign array
+0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 
+CFA memalign array
+1010101 7.7486e-304, 1010101 7.7486e-304, 1010101 7.7486e-304, 1010101 7.7486e-304, 1010101 7.7486e-304, 1010101 7.7486e-304, 1010101 7.7486e-304, 1010101 7.7486e-304, 1010101 7.7486e-304, 1010101 7.7486e-304, 
+
+CFA memset ffffffff -nan
+CFA memcpy ffffffff -nan
+
+CFA array memset
+ffffffff -nan, ffffffff -nan, ffffffff -nan, ffffffff -nan, ffffffff -nan, ffffffff -nan, ffffffff -nan, ffffffff -nan, ffffffff -nan, ffffffff -nan, 
+CFA memcpy
+deadbeef -17.2, deadbeef -17.2, deadbeef -17.2, deadbeef -17.2, deadbeef -17.2, deadbeef -17.2, deadbeef -17.2, deadbeef -17.2, deadbeef -17.2, deadbeef -17.2, 
+pointer arithmetic 0
+CFA deep malloc deadbeef
+
+SHOULD FAIL
Index: src/tests/alloc.c
===================================================================
--- src/tests/alloc.c	(revision 5e8d732708a3890c61f7eaff07bb0bffd32402cf)
+++ src/tests/alloc.c	(revision 5e8d732708a3890c61f7eaff07bb0bffd32402cf)
@@ -0,0 +1,226 @@
+// 
+// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// alloc.c -- 
+// 
+// Author           : Peter A. Buhr
+// Created On       : Wed Feb  3 07:56:22 2016
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon May 29 11:33:15 2017
+// Update Count     : 228
+// 
+
+#include <assert>
+extern "C" {
+#include <malloc.h>										// malloc_usable_size
+#include <stdint.h>										// uintptr_t
+} // extern
+#include <fstream>
+#include <stdlib>										// access C malloc, realloc
+
+int * foo( int * p, int c ) { return p; }
+int * bar( int * p, int c ) { return p; }
+int * baz( int * p, int c ) { return p; }
+
+int main( void ) {
+    size_t dim = 10;
+    struct S { int x; double y; } * s;
+    int * p;
+
+	// allocation, non-array types
+
+    p = (void *)malloc( sizeof(*p) );					// C malloc, type unsafe
+	*p = 0xdeadbeef;
+	printf( "C   malloc %x\n", *p );
+    free( p );
+
+    p = malloc();										// CFA malloc, type safe
+	printf( "CFA malloc %d\n", *p );
+    free( p );
+
+    p = malloc( '\1' );									// CFA malloc, fill
+	printf( "CFA malloc, fill %08x\n", *p );
+
+
+	// allocation, array types
+	printf( "\n" );
+
+    p = calloc( dim, sizeof( *p ) );					// C array calloc, type unsafe
+	printf( "C   calloc\n" );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
+	printf( "\n" );
+    free( p );
+
+    p = calloc( dim );									// CFA array calloc, type safe
+	printf( "CFA calloc\n" );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
+	printf( "\n" );
+    free( p );
+
+    p = amalloc( dim );									// CFA array malloc, type safe
+	printf( "CFA array malloc\n" );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
+	printf( "\n" );
+    free( p );
+
+    p = amalloc( 2 * dim, '\1' );						// CFA array malloc, fill
+	printf( "CFA array malloc\n" );
+	for ( int i = 0; i < 2 * dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
+	printf( "\n" );
+	// do not free
+
+
+	// resize, non-array types
+	printf( "\n" );
+
+    p = (void *)realloc( p, dim * sizeof(*p) );			// CFA realloc
+	printf( "C   realloc\n" );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
+	printf( "\n" );
+
+    p = realloc( p, 2 * dim * sizeof(*p) );				// CFA realloc
+	printf( "CFA realloc\n" );
+	for ( int i = 0; i < 2 * dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
+	printf( "\n" );
+
+    p = realloc( p, dim * sizeof(*p), '\1' );			// CFA realloc
+	printf( "CFA realloc\n" );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
+	printf( "\n" );
+
+    p = malloc( p, dim * sizeof(*p) );					// CFA malloc
+	printf( "CFA resize malloc\n" );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
+	printf( "\n" );
+
+    p = malloc( p, 2 * dim * sizeof(*p), '\1' );		// CFA malloc, fill
+	printf( "CFA resize malloc, fill\n" );
+	for ( int i = 0; i < 2 * dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
+	printf( "\n" );
+
+    p = malloc( p, dim * sizeof(*p), '\1' );			// CFA malloc, fill
+	printf( "CFA resize malloc, fill\n" );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
+	printf( "\n" );
+	// do not free
+
+
+	// resize, array types
+	printf( "\n" );
+
+    p = amalloc( p, 2 * dim );							// CFA array malloc
+	printf( "CFA resize array malloc\n" );
+	for ( int i = 0; i < 2 * dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
+	printf( "\n" );
+
+    p = amalloc( p, dim );								// CFA array malloc
+	printf( "CFA resize array malloc\n" );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
+	printf( "\n" );
+
+    p = amalloc( p, 2 * dim, '\1' );					// CFA array malloc, fill
+	printf( "CFA resize array malloc, fill\n" );
+	for ( int i = 0; i < 2 * dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
+	printf( "\n" );
+
+    p = amalloc( p, dim, '\1' );						// CFA array malloc, fill
+	printf( "CFA resize array malloc, fill\n" );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%x ", p[i] ); p[i] = 0Xdeadbeef; }
+	free( p );
+	printf( "\n" );
+
+    struct Struct { int x; double y; };
+    Struct st, st1, sta[dim], sta1[dim], * stp;
+
+
+	// alignment, non-array types
+	printf( "\n" );
+
+	enum { Alignment = 128 };
+    stp = aligned_alloc( Alignment );					// CFA aligned_alloc
+	*stp = (Struct){ 42, 42.5 };
+	assert( (uintptr_t)stp % Alignment == 0 );
+	printf( "CFA aligned_alloc %d %g\n", stp->x, stp->y );
+    free( stp );
+
+    stp = memalign( Alignment );						// CFA memalign
+	*stp = (Struct){ 42, 42.5 };
+	assert( (uintptr_t)stp % Alignment == 0 );
+	printf( "CFA memalign %d %g\n", stp->x, stp->y );
+    free( stp );
+
+    posix_memalign( &stp, Alignment );					// CFA posix_memalign
+	*stp = (Struct){ 42, 42.5 };
+	assert( (uintptr_t)stp % Alignment == 0 );
+	printf( "CFA posix_memalign %d %g\n", stp->x, stp->y );
+    free( stp );
+
+    stp = memalign( Alignment, '\1' );					// CFA memalign, fill
+	assert( (uintptr_t)stp % Alignment == 0 );
+	printf( "CFA memalign fill %d %g\n", stp->x, stp->y );
+    free( stp );
+
+
+	// alignment, array types
+	printf( "\n" );
+
+    stp = amemalign( Alignment, 2 * dim );				// CFA array memalign
+	assert( (uintptr_t)stp % Alignment == 0 );
+	printf( "CFA memalign array\n" );
+	for ( int i = 0; i < 2 * dim; i += 1 ) { printf( "%x %g, ", stp[i].x, stp[i].y ); stp[i].x = 0Xdeadbeef, stp[i].y = -17.2; }
+	printf( "\n" );
+    free( stp );
+
+    stp = amemalign( Alignment, dim, '\1' );			// CFA array memalign, fill
+	assert( (uintptr_t)stp % Alignment == 0 );
+	printf( "CFA memalign array\n" );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%x %g, ", stp[i].x, stp[i].y ); stp[i].x = 0Xdeadbeef, stp[i].y = -17.2; }
+	printf( "\n" );
+    free( stp );
+
+
+	// data, non-array types
+	printf( "\n" );
+
+    stp = memset( &st, '\xff' );						// CFA memset, type safe
+	printf( "CFA memset %x %g\n", st.x, st.y );
+    stp = memcpy( &st1, &st );							// CFA memcpy, type safe
+	printf( "CFA memcpy %x %g\n", st1.x, st1.y );
+
+
+	// data, array types
+	printf( "\n" );
+
+    stp = amemset( sta, dim, '\xff' );					// CFA array memset, type safe
+	printf( "CFA array memset\n" );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%x %g, ", sta[i].x, sta[i].y ); sta[i].x = 0Xdeadbeef, sta[i].y = -17.2; }
+	printf( "\n" );
+
+    stp = amemcpy( sta1, sta, dim );					// CFA array memcpy, type safe
+	printf( "CFA memcpy\n" );
+	for ( int i = 0; i < dim; i += 1 ) { printf( "%x %g, ", sta1[i].x, sta1[i].y ); sta1[i].x = 0Xdeadbeef, sta1[i].y = -17.2; }
+	printf( "\n" );
+
+    float * fp = malloc() + 1;
+    printf( "pointer arithmetic %d\n", fp == fp - 1 );
+    free( fp - 1 );
+
+    p = foo( bar( baz( malloc(), 0 ), 0 ), 0 );
+	*p = 0xdeadbeef;
+	printf( "CFA deep malloc %x\n", *p );
+    free( p );
+
+	stp = malloc();
+	printf( "\nSHOULD FAIL\n" );
+    p = malloc( stp, dim * sizeof(*stp) );
+    p = memset( stp, 10 );
+    p = memcpy( &st1, &st );
+} // main
+
+// Local Variables: //
+// tab-width: 4 //
+// compile-command: "cfa alloc.c" //
+// End: //
