The Complete SPRLIB & ANNLIB

calloc_monitor

- an SPRANNLIB replacement for the calloc routine

SYNOPSIS

char *calloc_monitor (nelm, size, file, line)

ARGUMENTS

unsigned int nelem The number of elements to be allocated.
unsigned int size The number of bytes per element.
char *file The name of the source-file from which this function was called.
int line The line in the source-file from which this function was called.

RETURNS

A pointer to an allocated block of memory if succesful, NULL if not.

FUNCTION

This function can replace the standard C-function calloc. Besides calling calloc to allocate a block of memory, it allocates a MALINFO structure, fills it and inserts it into the linked list (topmem, endmem - see MONITOR-ALLOCATION-variables).

NOTE

If the routine finds topmem to be NULL (indicating no memory was yet allocated using these routines), it calls set_sigsegv_handler. The free_monitor routine has to be used to deallocate a block of memory allocated by this routine.

SEE ALSO

MONITOR-ALLOCATION-functions, malloc_monitor, realloc_monitor , free_monitor, status_monitor, memory_monitor

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