The Complete SPRLIB & ANNLIB

MONITOR-ALLOCATION-functions

- sprlib memory allocation routines replacing the original C-functions

SYNOPSIS

#define malloc(size)          malloc_monitor(size,__FILE__,__LINE__)
#define calloc(nelem,size)    calloc_monitor(nelem,size,__FILE__,__LINE__)
#define realloc(ptr,size)     realloc_monitor(ptr,size,__FILE__,__LINE__)
#define free(ptr)             free_monitor(ptr,__FILE__,__LINE__)

DESCRIPTION

The standard C-functions are replaced by SPRANNLIB's memory allocation monitoring routines when the NO_MONITOR flag is not set during compilation (see LIBRARY-flags). Each memory allocation will be stored together with source-file and -line information for later reference and debugging purposes.

NOTE

These replacements and the original functions cannot be used with each other, since the replacement functions store information about each allocated block of memory and will give error messages if a program tries to free an unallocated block of memory or if memory allocated with one of these functions is freed by another function (indicating memory leakage).

SEE ALSO

malloc_monitor, calloc_monitor, realloc_monitor, free_monitor , memory_monitor, status_monitor

This document was generated using api2html on Thu Mar 5 09:00:00 MET DST 1998