| .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) |
| .\" Distributed under GPL |
| .\" the glibc-info pages are very helpful here |
| .TH MTRACE 3 2002-07-20 "GNU" "Linux Programmer's Manual" |
| .SH NAME |
| mtrace, muntrace \- malloc debugging |
| .SH SYNOPSIS |
| .sp |
| .B "#include <mcheck.h>" |
| .sp |
| .B "void mtrace(void);" |
| .sp |
| .B "void muntrace(void);" |
| .SH DESCRIPTION |
| The function |
| .BR mtrace () |
| installs handlers for |
| .BR malloc (), |
| .BR realloc () |
| and |
| .BR free (). |
| The function |
| .BR muntrace () |
| disables these handlers. |
| .br |
| The environment variable |
| .B MALLOC_TRACE |
| defines a file where |
| .BR mtrace () |
| writes its output. |
| This file must be writable to the user or |
| .BR mtrace () |
| will do nothing. |
| If the file is not empty it will be truncated. |
| .SH NOTE |
| The output of |
| .BR mtrace () |
| will be ASCII but not in a friendly format. |
| So glibc comes with a perl-script called mtrace to make sense of it. |
| .SH "CONFORMS TO" |
| These are GNU extensions. |
| .SH "SEE ALSO" |
| .BR malloc (3), |
| .BR malloc_hook (3) |