GNU/Linux |
CentOS 5.3 |
|
![]() |
mtrace(3) |
![]() |
mtrace, muntrace − malloc debugging
#include <mcheck.h>
void mtrace(void);
void muntrace(void);
The function
mtrace() installs handlers for malloc(),
realloc() and free(). The function
muntrace() disables these handlers.
The environment variable MALLOC_TRACE defines a file
where mtrace() writes its output. This file must be
writable to the user or mtrace() will do nothing. If
the file is not empty it will be truncated.
The output of mtrace() will be ASCII but not in a friendly format. So glibc comes with a perl-script called mtrace to make sense of it.
These are GNU extensions.
malloc(3), malloc_hook(3)
![]() |
mtrace(3) | ![]() |