text: The following form allows you to view linux man pages.
  #include <mcheck.h>
  int mcheck(void (*abortfunc)(enum mcheck_status mstatus));
  int mcheck_pedantic(void (*abortfunc)(enum mcheck_status mstatus));
  void mcheck_check_all(void);
  enum mcheck_status mprobe(void *ptr);
  The mcheck() function installs a set of debugging hooks for the mal-
  loc(3) family of memory-allocation functions. These hooks cause cer-
  tain consistency checks to be performed on the state of the heap. The
  checks can detect application errors such as freeing a block of memory
  more than once or corrupting the bookkeeping data structures that imme-
  diately precede a block of allocated memory.
  To be effective, the mcheck() function must be called before the first
  call to malloc(3) or a related function. In cases where this is diffi-
  cult to ensure, linking the program with -lmcheck inserts an implicit
  call to mcheck() (with a NULL argument) before the first call to a mem-
  ory-allocation function.
  The mcheck_pedantic() function is similar to mcheck(), but performs
  checks on all allocated blocks whenever one of the memory-allocation
  functions is called. This can be very slow!
  The mcheck_check_all() function causes an immediate check on all allo-
  cated blocks. This call is effective only if mcheck() is called
  beforehand.
  If the system detects an inconsistency in the heap, the caller-supplied
  function pointed to by abortfunc is invoked with a single argument func-
  tion was called. Consistency checking is not possible.
  MCHECK_OK (mprobe() only)
  The mcheck_pedantic() and mcheck_check_all() functions are available
  since glibc 2.2. The mcheck() and mprobe() functions are present since
  at least glibc 2.0
  These functions are GNU extensions.
  Linking a program with -lmcheck and using the MALLOC_CHECK_ environment
  variable (described in mallopt(3)) cause the same kinds of errors to be
  detected. But, using MALLOC_CHECK_ does not require the application to
  be relinked.
  The program below calls mcheck() with a NULL argument and then frees
  the same block of memory twice. The following shell session demon-
  strates);
  }
  webmaster@linuxguruz.com