rciMalloc(3)

NAME
rciMalloc, rciFree -- memory allocation routines for the RCI control level.

USAGE
#include <rci.h>

void *rciMalloc(size)
   int size;

rciFree(mem)
   void *mem;

ARGUMENTS

size --
    Size of the requested memory segment, in bytes.

mem --
    Pointer to a previously allocated memory segment.

RESTRICTIONS
These routines will not work until after the first call to rciCreate().

DESCRIPTION
These routines provide dynamic memory allocation at the RCI control level.

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

rciFree() frees a memory segment previously allocated by rciMalloc(). In general, 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 rciFree() at the control level for memory allocated by calling rciMalloc() at the planning level).

DIAGNOSTICS
rciMalloc() returns NULL if rciCreate() has not yet been called, or if there is not enough memory for the desired allocation.

SEE ALSO
rciCreate(3), rciPrintf(3), rciSignal(3).