Next: Variable argument list functions
Up: Conventions and style
Previous: Function/name prefixes and case
Contents
A convention used extensively in the linear algebra and image packages is
to provide ``quick'' and ``slow'' versions of the same operation,
indicating the difference using the suffices ..._q and ..._s
respectively. The meanings of the suffices vary, but are one of:
- The ``slow'' version dynamically allocates the memory to hold the
result, whereas the ``quick'' version uses a pre-allocated result
passed in to the function, avoiding repetitively allocating and
freeing memory when the function is called several times.
This is the convention used in the image package and for general size
matrix and vector functions in the linear algebra package.
- The ``slow'' version returns a structure as its result, and the
``quick'' version expects a pointer to the result structure to be
passed in. This is the convention used for fixed-size matrices and
vectors in the linear algebra package.
There is also a conventional ..._i suffix for operations that overwrite
one of the input arguments with the result.
Next: Variable argument list functions
Up: Conventions and style
Previous: Function/name prefixes and case
Contents
2006-03-17