summaryrefslogtreecommitdiffstats
path: root/doc/DumpActiveMemory.3
blob: bdab746277a5feff5a9f8bfa30d1d53d35b2cefa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
'\"
'\" Copyright (c) 1992-1999 Karl Lehenbauer and Mark Diekhans.
'\" Copyright (c) 2000 by Scriptics Corporation.
'\" All rights reserved.
'\" 
'\" RCS: @(#) $Id: DumpActiveMemory.3,v 1.8 2004/10/07 15:15:36 dkf Exp $
'\" 
.so man.macros
.TH "Tcl_DumpActiveMemory" 3 8.1 Tcl "Tcl Library Procedures"
.BS
.SH NAME
Tcl_DumpActiveMemory, Tcl_InitMemory, Tcl_ValidateAllMemory \- Validated memory allocation interface
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
.sp
int
\fBTcl_DumpActiveMemory\fR(\fIfileName\fR)
.sp
void
\fBTcl_InitMemory\fR(\fIinterp\fR)
.sp
void
\fBTcl_ValidateAllMemory\fR(\fIfileName, line\fR)

.SH ARGUMENTS
.AS Tcl_Interp *fileName
.AP Tcl_Interp *interp in
Tcl interpreter in which to add commands.
.AP "const char" *fileName in
For \fBTcl_DumpActiveMemory\fR, name of the file to which memory
information will be written.  For \fBTcl_ValidateAllMemory\fR, name of
the file from which the call is being made (normally \fB__FILE__\fR).
.AP int line in
Line number at which the call to \fBTcl_ValidateAllMemory\fR is made
(normally \fB__LINE__\fR).
.BE

.SH DESCRIPTION
These functions provide access to Tcl memory debugging information.
They are only functional when Tcl has been compiled with
\fBTCL_MEM_DEBUG\fR defined at compile-time.  When \fBTCL_MEM_DEBUG\fR
is not defined, these functions are all no-ops.
.PP 
\fBTcl_DumpActiveMemory\fR will output a list of all currently
allocated memory to the specified file.  The information output for
each allocated block of memory is:  starting and ending addresses
(excluding guard zone), size, source file where \fBckalloc\fR was
called to allocate the block and line number in that file.  It is
especially useful to call \fBTcl_DumpActiveMemory\fR after the Tcl
interpreter has been deleted.
.PP
\fBTcl_InitMemory\fR adds the Tcl \fBmemory\fR command to the
interpreter given by \fIinterp\fR.  \fBTcl_InitMemory\fR is called
by \fBTcl_Main\fR.
.PP
\fBTcl_ValidateAllMemory\fR forces a validation of the guard zones of
all currently allocated blocks of memory.  Normally validation of a
block occurs when its freed, unless full validation is enabled, in
which case validation of all blocks occurs when \fBckalloc\fR and
\fBckfree\fR are called.  This function forces the validation to occur
at any point.

.SH "SEE ALSO"
TCL_MEM_DEBUG, memory

.SH KEYWORDS
memory, debug


in -rw-r--r--regerror.c3710logstatsplain -rw-r--r--regerrs.h1137logstatsplain -rw-r--r--regex.h11263logstatsplain -rw-r--r--regexec.c31812logstatsplain -rw-r--r--regfree.c2177logstatsplain -rw-r--r--regfronts.c2499logstatsplain -rw-r--r--regguts.h12722logstatsplain -rw-r--r--tcl.decls64687logstatsplain -rw-r--r--tcl.h92762logstatsplain -rw-r--r--tclAlloc.c17921logstatsplain -rw-r--r--tclAssembly.c132429logstatsplain -rw-r--r--tclAsync.c10017logstatsplain -rw-r--r--tclBasic.c258014logstatsplain -rw-r--r--tclBinary.c69416logstatsplain -rw-r--r--tclCkalloc.c32418logstatsplain -rw-r--r--tclClock.c53783logstatsplain -rw-r--r--tclCmdAH.c70516logstatsplain -rw-r--r--tclCmdIL.c121751logstatsplain -rw-r--r--tclCmdMZ.c123609logstatsplain -rw-r--r--tclCompCmds.c123012logstatsplain -rw-r--r--tclCompCmdsSZ.c101448logstatsplain -rw-r--r--tclCompExpr.c84375logstatsplain -rw-r--r--tclCompile.c145696logstatsplain -rw-r--r--tclCompile.h59220logstatsplain -rw-r--r--tclConfig.c10315logstatsplain -rw-r--r--tclDTrace.d7347logstatsplain -rw-r--r--tclDate.c78503logstatsplain -rw-r--r--tclDecls.h164617logstatsplain -rw-r--r--tclDictObj.c89324logstatsplain -rw-r--r--tclEncoding.c103321logstatsplain -rw-r--r--tclEnsemble.c83741logstatsplain -rw-r--r--tclEnv.c20938logstatsplain -rw-r--r--tclEvent.c43175logstatsplain -rw-r--r--tclExecute.c246543logstatsplain -rw-r--r--tclFCmd.c38885logstatsplain -rw-r--r--tclFileName.c69755logstatsplain -rw-r--r--tclFileSystem.h4229logstatsplain -rw-r--r--tclGet.c4070logstatsplain -rw-r--r--tclGetDate.y28171logstatsplain -rw-r--r--tclHash.c29856logstatsplain -rw-r--r--tclHistory.c5709logstatsplain -rw-r--r--tclIO.c311811logstatsplain -rw-r--r--tclIO.h17643logstatsplain -rw-r--r--tclIOCmd.c53267logstatsplain -rw-r--r--tclIOGT.c37715logstatsplain -rw-r--r--tclIORChan.c86333logstatsplain -rw-r--r--tclIORTrans.c90308logstatsplain -rw-r--r--tclIOSock.c7162logstatsplain -rw-r--r--tclIOUtil.c132498logstatsplain -rw-r--r--tclIndexObj.c41905logstatsplain -rw-r--r--tclInt.decls33008logstatsplain -rw-r--r--tclInt.h180426logstatsplain -rw-r--r--tclIntDecls.h50952logstatsplain -rw-r--r--tclIntPlatDecls.h16506logstatsplain -rw-r--r--tclInterp.c131968logstatsplain -rw-r--r--tclLink.c19569logstatsplain -rw-r--r--tclListObj.c58655logstatsplain -rw-r--r--tclLiteral.c34432logstatsplain -rw-r--r--tclLoad.c33018logstatsplain -rw-r--r--tclLoadNone.c2447logstatsplain -rw-r--r--tclMain.c25292logstatsplain -rw-r--r--tclNamesp.c154469logstatsplain -rw-r--r--tclNotify.c31181logstatsplain -rw-r--r--tclOO.c76604logstatsplain -rw-r--r--tclOO.decls6077logstatsplain -rw-r--r--tclOO.h4244logstatsplain -rw-r--r--tclOOBasic.c35296logstatsplain -rw-r--r--tclOOCall.c41653logstatsplain -rw-r--r--tclOODecls.h8990logstatsplain -rw-r--r--tclOODefineCmds.c52374logstatsplain -rw-r--r--tclOOInfo.c38568logstatsplain -rw-r--r--tclOOInt.h24673logstatsplain -rw-r--r--tclOOIntDecls.h7267logstatsplain -rw-r--r--tclOOMethod.c51888logstatsplain -rw-r--r--tclOOStubInit.c2243logstatsplain -rw-r--r--tclOOStubLib.c2172logstatsplain -rw-r--r--tclObj.c130630logstatsplain -rw-r--r--tclPanic.c3512logstatsplain -rw-r--r--tclParse.c75605logstatsplain -rw-r--r--tclPathObj.c75398logstatsplain -rw-r--r--tclPipe.c31352logstatsplain -rw-r--r--tclPkg.c53289logstatsplain -rw-r--r--tclPkgConfig.c3405logstatsplain -rw-r--r--tclPlatDecls.h3199logstatsplain -rw-r--r--tclPort.h1417logstatsplain -rw-r--r--tclPosixStr.c30254logstatsplain -rw-r--r--tclPreserve.c13130logstatsplain -rw-r--r--tclProc.c87223logstatsplain -rw-r--r--tclRegexp.c31291logstatsplain -rw-r--r--tclRegexp.h1668logstatsplain -rw-r--r--tclResolve.c13624logstatsplain -rw-r--r--tclResult.c46166logstatsplain -rw-r--r--tclScan.c23482logstatsplain -rwxr-xr-xtclStrToD.c132595logstatsplain