OSDN Git Service

dc84732ad1c14148931802f20381c0eb5f8e5e5e
[linuxjm/LDP_man-pages.git] / original / man3 / mtrace.3
1 .\"  Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\"  Distributed under GPL
3 .\"  the glibc-info pages are very helpful here
4 .TH MTRACE 3 2002-07-20 "GNU" "Linux Programmer's Manual"
5 .SH NAME
6 mtrace, muntrace \- malloc debugging
7 .SH SYNOPSIS
8 .B "#include <mcheck.h>"
9 .sp
10 .B "void mtrace(void);"
11 .sp
12 .B "void muntrace(void);"
13 .SH DESCRIPTION
14 The function
15 .BR mtrace ()
16 installs handlers for
17 .BR malloc (3),
18 .BR realloc (3)
19 and
20 .BR free (3).
21 The function
22 .BR muntrace ()
23 disables these handlers.
24 .br
25 The environment variable
26 .B MALLOC_TRACE
27 defines a file where
28 .BR mtrace ()
29 writes its output.
30 This file must be writable to the user or
31 .BR mtrace ()
32 will do nothing.
33 If the file is not empty it will be truncated.
34 .SH "CONFORMING TO"
35 These are GNU extensions.
36 .SH NOTES
37 The output of
38 .BR mtrace ()
39 will be ASCII but not in a friendly format.
40 So glibc comes with a perl-script called mtrace to make sense of it.
41 .SH "SEE ALSO"
42 .BR malloc (3),
43 .BR malloc_hook (3)