The checks can detect application errors such as freeing a block of memory
more than once or corrupting the bookkeeping data structures
that immediately precede a block of allocated memory.
-
+.PP
To be effective, the
.BR mcheck ()
function must be called before the first call to
.BR mcheck ()
(with a NULL argument)
before the first call to a memory-allocation function.
-
+.PP
The
.BR mcheck_pedantic ()
function is similar to
but performs checks on all allocated blocks whenever
one of the memory-allocation functions is called.
This can be very slow!
-
+.PP
The
.BR mcheck_check_all ()
function causes an immediate check on all allocated blocks.
This call is effective only if
.BR mcheck ()
is called beforehand.
-
+.PP
If the system detects an inconsistency in the heap,
the caller-supplied function pointed to by
.I abortfunc
.IR stderr
and calls
.BR abort (3).
-
+.PP
The
.BR mprobe ()
function performs a consistency check on
.BR mprobe ()
returns
.BR MCHECK_DISABLED ).
-
+.PP
The following list describes the values returned by
.BR mprobe ()
or passed as the
const:malloc_hooks
T}
.TE
-
+.sp 1
.SH CONFORMING TO
These functions are GNU extensions.
.SH NOTES