Node:Tracing malloc, Next:Using the Memory Debugger, Up:Allocation Debugging
void mtrace (void) | Function |
When the mtrace function is called it looks for an environment
variable named MALLOC_TRACE . This variable is supposed to
contain a valid file name. The user must have write access. If the
file already exists it is truncated. If the environment variable is not
set or it does not name a valid file which can be opened for writing
nothing is done. The behavior of malloc etc. is not changed.
For obvious reasons this also happens if the application is installed
with the SUID or SGID bit set.
If the named file is successfully opened, This function is a GNU extension and generally not available on other
systems. The prototype can be found in |
void muntrace (void) | Function |
The muntrace function can be called after mtrace was used
to enable tracing the malloc calls. If no (successful) call of
mtrace was made muntrace does nothing.
Otherwise it deinstalls the handlers for This function is a GNU extension and generally not available on other
systems. The prototype can be found in |