[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Naming conventions and Allocation/Deallocation schemes

The general rule is that all type and function names defined by the library are prefixed with ap_, in order to prevent name conflicts with other libraries. Moreover, functions operating on objects of type ap_typ_t are usually prefixed with ap_typ_op.

Given an object of datatype ap_typ_t*, two kinds of allocation/deallocation pairs of functions may be defined:

  1. variable declaration: ap_typ_t obj; this pair of functions follows the semantics used in the GMP library. The first function initializes the object of type ap_typ_t pointed to by arg, and fills it with a valid content. The second function deallocates the memory possibly pointed to by fields of the object *arg, but do not attempt to deallocate the memory pointed by arg.
  2. variable declaration: ap_typ_t* obj; the first function allocates an object of type typ_t and then calls a ap_typ_init-like function on the result; the second functions first call a ap_typ_clear-like function and then deallocate the memory pointed by arg.

This document was generated on September, 10 2009 using texi2html