\input manualMacros.tex
\manBegin
\manPageInfo{RCI Reference Manual}{}{}
\manTitle{rciMalloc}{3}
\manSection{NAME}
{\rightskip=0ptplus1fil
{\tt \manName{rciMalloc}},
{\tt \manName{rciFree}}
-- memory allocation routines for the RCI control level.

}
\manSection{USAGE}
\cverbatim
#include <rci.h>

void *rciMalloc(size)
   int size;

rciFree(mem)
   void *mem;
@endcverbatim
\manSection{ARGUMENTS}
\manItem{{\tt size} --}
Size of the requested memory segment, in bytes.
\manItem{{\tt mem} --}
Pointer to a previously allocated memory segment.
\manSection{RESTRICTIONS}
These routines will not work until after the first call to 
{\tt rciCreate()}. 
\manSection{DESCRIPTION}
These routines provide dynamic memory allocation
at the RCI control level.

{\tt rciMalloc()} allocates a memory segment of {\tt size} bytes and 
returns a pointer to it. If called from the planning level, 
this turns into a {\tt malloc()} call.

{\tt rciFree()} frees a memory segment previously allocated by
{\tt rciMalloc()}. In general, {\tt rciFree()} should only be called
for memory segments that were allocated within the same task.
In practice, the only real limitation is that the memory must have
been allocated from a task residing on the same CPU, and must also have
been allocated at the same program level (i.e., don't call {\tt rciFree()}
at the control level for memory allocated by calling {\tt rciMalloc()}
at the planning level).

\manSection{DIAGNOSTICS}
{\tt rciMalloc()} returns {\tt NULL} if {\tt rciCreate()} has not
yet been called, or if there is not enough memory for the desired
allocation.
\manSection{SEE ALSO}
\rightskip=0ptplus1fil
{\tt rciCreate(3)}, {\tt rciPrintf(3)}, {\tt rciSignal(3)}.

\manEnd
\end
