1Tcl_DumpActiveMemory(3)     Tcl Library Procedures     Tcl_DumpActiveMemory(3)
2
3
4
5______________________________________________________________________________
6

NAME

8       Tcl_DumpActiveMemory, Tcl_InitMemory, Tcl_ValidateAllMemory - Validated
9       memory allocation interface
10

SYNOPSIS

12       #include <tcl.h>
13
14       int
15       Tcl_DumpActiveMemory(fileName)
16
17       void
18       Tcl_InitMemory(interp)
19
20       void
21       Tcl_ValidateAllMemory(fileName, line)
22
23

ARGUMENTS

25       Tcl_Interp *interp (in)            Tcl interpreter in which to add com‐
26                                          mands.
27
28       const char *fileName (in)          For  Tcl_DumpActiveMemory,  name  of
29                                          the file to which memory information
30                                          will   be  written.   For  Tcl_Vali‐
31                                          dateAllMemory, name of the file from
32                                          which  the  call is being made (nor‐
33                                          mally __FILE__).
34
35       int line (in)                      Line number at  which  the  call  to
36                                          Tcl_ValidateAllMemory  is made (nor‐
37                                          mally __LINE__).
38_________________________________________________________________
39
40

DESCRIPTION

42       These functions provide access to  Tcl  memory  debugging  information.
43       They  are only functional when Tcl has been compiled with TCL_MEM_DEBUG
44       defined at compile-time.  When  TCL_MEM_DEBUG  is  not  defined,  these
45       functions are all no-ops.
46
47       Tcl_DumpActiveMemory will output a list of all currently allocated mem‐
48       ory to the specified file.  The information output for  each  allocated
49       block  of  memory  is:   starting and ending addresses (excluding guard
50       zone), size, source file where ckalloc was called to allocate the block
51       and  line  number  in  that  file.   It  is  especially  useful to call
52       Tcl_DumpActiveMemory after the Tcl interpreter has been deleted.
53
54       Tcl_InitMemory adds the Tcl memory command to the interpreter given  by
55       interp.  Tcl_InitMemory is called by Tcl_Main.
56
57       Tcl_ValidateAllMemory  forces  a  validation  of the guard zones of all
58       currently allocated blocks of memory.  Normally validation of  a  block
59       occurs when its freed, unless full validation is enabled, in which case
60       validation of all blocks occurs when ckalloc  and  ckfree  are  called.
61       This function forces the validation to occur at any point.
62
63

SEE ALSO

65       TCL_MEM_DEBUG, memory
66
67

KEYWORDS

69       memory, debug
70
71
72
73
74
75Tcl                                   8.1              Tcl_DumpActiveMemory(3)
Impressum