In addition to the standard functions, AST provides other memory management functions, such as:
Theses are just a few of the available utilities functions in the AST memory management layer. Prototypes for all AST memory management functions are included in the header file ``ast.h''.
An important restriction on these functions is that pointers created by other memory management functions, such as the system version of malloc etc., should never supplied to an AST memory management function. Only pointers created by AST should be used by these functions.
In addition to memory management functions, AST provides various other utility functions, such as a basic regular expression facility, and other string manipulation functions. These are also documented in this appendix.
The AST memory management layer is implemented on top of the usual malloc, tt free and realloc functions. By default these will be the standard functions provided by <stdlib.h>. However, the facilities of the STARMEM package (included in the Starlink Software Collection) can be used to specify alternative functions to use. This requires that AST be configured using the ``-with-starmem'' option when it is built.
The STARMEM package provides a wrapper for the standard malloc implementation that enables the user to switch malloc schemes at runtime by setting the STARMEM_MALLOC environment variable. Currently allowed values for this variable are: