The Complete SPRLIB & ANNLIB

malloc_monitor

- an SPRANNLIB replacement for the malloc routine

SYNOPSIS

char *malloc_monitor (size, file, line)

ARGUMENTS

unsigned int size The number of bytes to be allocated.
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 malloc. Besides calling malloc 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, calloc_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