OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/hostdependX86LINUX64.git] / util / X86LINUX64 / man / man3 / Tcl_InitMemory.3
1 '\"
2 '\" Copyright (c) 1992-1999 Karl Lehenbauer and Mark Diekhans.
3 '\" Copyright (c) 2000 by Scriptics Corporation.
4 '\" All rights reserved.
5 '\" 
6 .TH "Tcl_DumpActiveMemory" 3 8.1 Tcl "Tcl Library Procedures"
7 .\" The -*- nroff -*- definitions below are for supplemental macros used
8 .\" in Tcl/Tk manual entries.
9 .\"
10 .\" .AP type name in/out ?indent?
11 .\"     Start paragraph describing an argument to a library procedure.
12 .\"     type is type of argument (int, etc.), in/out is either "in", "out",
13 .\"     or "in/out" to describe whether procedure reads or modifies arg,
14 .\"     and indent is equivalent to second arg of .IP (shouldn't ever be
15 .\"     needed;  use .AS below instead)
16 .\"
17 .\" .AS ?type? ?name?
18 .\"     Give maximum sizes of arguments for setting tab stops.  Type and
19 .\"     name are examples of largest possible arguments that will be passed
20 .\"     to .AP later.  If args are omitted, default tab stops are used.
21 .\"
22 .\" .BS
23 .\"     Start box enclosure.  From here until next .BE, everything will be
24 .\"     enclosed in one large box.
25 .\"
26 .\" .BE
27 .\"     End of box enclosure.
28 .\"
29 .\" .CS
30 .\"     Begin code excerpt.
31 .\"
32 .\" .CE
33 .\"     End code excerpt.
34 .\"
35 .\" .VS ?version? ?br?
36 .\"     Begin vertical sidebar, for use in marking newly-changed parts
37 .\"     of man pages.  The first argument is ignored and used for recording
38 .\"     the version when the .VS was added, so that the sidebars can be
39 .\"     found and removed when they reach a certain age.  If another argument
40 .\"     is present, then a line break is forced before starting the sidebar.
41 .\"
42 .\" .VE
43 .\"     End of vertical sidebar.
44 .\"
45 .\" .DS
46 .\"     Begin an indented unfilled display.
47 .\"
48 .\" .DE
49 .\"     End of indented unfilled display.
50 .\"
51 .\" .SO ?manpage?
52 .\"     Start of list of standard options for a Tk widget. The manpage
53 .\"     argument defines where to look up the standard options; if
54 .\"     omitted, defaults to "options". The options follow on successive
55 .\"     lines, in three columns separated by tabs.
56 .\"
57 .\" .SE
58 .\"     End of list of standard options for a Tk widget.
59 .\"
60 .\" .OP cmdName dbName dbClass
61 .\"     Start of description of a specific option.  cmdName gives the
62 .\"     option's name as specified in the class command, dbName gives
63 .\"     the option's name in the option database, and dbClass gives
64 .\"     the option's class in the option database.
65 .\"
66 .\" .UL arg1 arg2
67 .\"     Print arg1 underlined, then print arg2 normally.
68 .\"
69 .\" .QW arg1 ?arg2?
70 .\"     Print arg1 in quotes, then arg2 normally (for trailing punctuation).
71 .\"
72 .\" .PQ arg1 ?arg2?
73 .\"     Print an open parenthesis, arg1 in quotes, then arg2 normally
74 .\"     (for trailing punctuation) and then a closing parenthesis.
75 .\"
76 .\"     # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
77 .if t .wh -1.3i ^B
78 .nr ^l \n(.l
79 .ad b
80 .\"     # Start an argument description
81 .de AP
82 .ie !"\\$4"" .TP \\$4
83 .el \{\
84 .   ie !"\\$2"" .TP \\n()Cu
85 .   el          .TP 15
86 .\}
87 .ta \\n()Au \\n()Bu
88 .ie !"\\$3"" \{\
89 \&\\$1 \\fI\\$2\\fP (\\$3)
90 .\".b
91 .\}
92 .el \{\
93 .br
94 .ie !"\\$2"" \{\
95 \&\\$1  \\fI\\$2\\fP
96 .\}
97 .el \{\
98 \&\\fI\\$1\\fP
99 .\}
100 .\}
101 ..
102 .\"     # define tabbing values for .AP
103 .de AS
104 .nr )A 10n
105 .if !"\\$1"" .nr )A \\w'\\$1'u+3n
106 .nr )B \\n()Au+15n
107 .\"
108 .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
109 .nr )C \\n()Bu+\\w'(in/out)'u+2n
110 ..
111 .AS Tcl_Interp Tcl_CreateInterp in/out
112 .\"     # BS - start boxed text
113 .\"     # ^y = starting y location
114 .\"     # ^b = 1
115 .de BS
116 .br
117 .mk ^y
118 .nr ^b 1u
119 .if n .nf
120 .if n .ti 0
121 .if n \l'\\n(.lu\(ul'
122 .if n .fi
123 ..
124 .\"     # BE - end boxed text (draw box now)
125 .de BE
126 .nf
127 .ti 0
128 .mk ^t
129 .ie n \l'\\n(^lu\(ul'
130 .el \{\
131 .\"     Draw four-sided box normally, but don't draw top of
132 .\"     box if the box started on an earlier page.
133 .ie !\\n(^b-1 \{\
134 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
135 .\}
136 .el \}\
137 \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
138 .\}
139 .\}
140 .fi
141 .br
142 .nr ^b 0
143 ..
144 .\"     # VS - start vertical sidebar
145 .\"     # ^Y = starting y location
146 .\"     # ^v = 1 (for troff;  for nroff this doesn't matter)
147 .de VS
148 .if !"\\$2"" .br
149 .mk ^Y
150 .ie n 'mc \s12\(br\s0
151 .el .nr ^v 1u
152 ..
153 .\"     # VE - end of vertical sidebar
154 .de VE
155 .ie n 'mc
156 .el \{\
157 .ev 2
158 .nf
159 .ti 0
160 .mk ^t
161 \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
162 .sp -1
163 .fi
164 .ev
165 .\}
166 .nr ^v 0
167 ..
168 .\"     # Special macro to handle page bottom:  finish off current
169 .\"     # box/sidebar if in box/sidebar mode, then invoked standard
170 .\"     # page bottom macro.
171 .de ^B
172 .ev 2
173 'ti 0
174 'nf
175 .mk ^t
176 .if \\n(^b \{\
177 .\"     Draw three-sided box if this is the box's first page,
178 .\"     draw two sides but no top otherwise.
179 .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
180 .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
181 .\}
182 .if \\n(^v \{\
183 .nr ^x \\n(^tu+1v-\\n(^Yu
184 \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
185 .\}
186 .bp
187 'fi
188 .ev
189 .if \\n(^b \{\
190 .mk ^y
191 .nr ^b 2
192 .\}
193 .if \\n(^v \{\
194 .mk ^Y
195 .\}
196 ..
197 .\"     # DS - begin display
198 .de DS
199 .RS
200 .nf
201 .sp
202 ..
203 .\"     # DE - end display
204 .de DE
205 .fi
206 .RE
207 .sp
208 ..
209 .\"     # SO - start of list of standard options
210 .de SO
211 'ie '\\$1'' .ds So \\fBoptions\\fR
212 'el .ds So \\fB\\$1\\fR
213 .SH "STANDARD OPTIONS"
214 .LP
215 .nf
216 .ta 5.5c 11c
217 .ft B
218 ..
219 .\"     # SE - end of list of standard options
220 .de SE
221 .fi
222 .ft R
223 .LP
224 See the \\*(So manual entry for details on the standard options.
225 ..
226 .\"     # OP - start of full description for a single option
227 .de OP
228 .LP
229 .nf
230 .ta 4c
231 Command-Line Name:      \\fB\\$1\\fR
232 Database Name:  \\fB\\$2\\fR
233 Database Class: \\fB\\$3\\fR
234 .fi
235 .IP
236 ..
237 .\"     # CS - begin code excerpt
238 .de CS
239 .RS
240 .nf
241 .ta .25i .5i .75i 1i
242 ..
243 .\"     # CE - end code excerpt
244 .de CE
245 .fi
246 .RE
247 ..
248 .\"     # UL - underline word
249 .de UL
250 \\$1\l'|0\(ul'\\$2
251 ..
252 .\"     # QW - apply quotation marks to word
253 .de QW
254 .ie '\\*(lq'"' ``\\$1''\\$2
255 .\"" fix emacs highlighting
256 .el \\*(lq\\$1\\*(rq\\$2
257 ..
258 .\"     # PQ - apply parens and quotation marks to word
259 .de PQ
260 .ie '\\*(lq'"' (``\\$1''\\$2)\\$3
261 .\"" fix emacs highlighting
262 .el (\\*(lq\\$1\\*(rq\\$2)\\$3
263 ..
264 .\"     # QR - quoted range
265 .de QR
266 .ie '\\*(lq'"' ``\\$1''\\-``\\$2''\\$3
267 .\"" fix emacs highlighting
268 .el \\*(lq\\$1\\*(rq\\-\\*(lq\\$2\\*(rq\\$3
269 ..
270 .\"     # MT - "empty" string
271 .de MT
272 .QW ""
273 ..
274 .BS
275 .SH NAME
276 Tcl_DumpActiveMemory, Tcl_InitMemory, Tcl_ValidateAllMemory \- Validated memory allocation interface
277 .SH SYNOPSIS
278 .nf
279 \fB#include <tcl.h>\fR
280 .sp
281 int
282 \fBTcl_DumpActiveMemory\fR(\fIfileName\fR)
283 .sp
284 void
285 \fBTcl_InitMemory\fR(\fIinterp\fR)
286 .sp
287 void
288 \fBTcl_ValidateAllMemory\fR(\fIfileName, line\fR)
289
290 .SH ARGUMENTS
291 .AS Tcl_Interp *fileName
292 .AP Tcl_Interp *interp in
293 Tcl interpreter in which to add commands.
294 .AP "const char" *fileName in
295 For \fBTcl_DumpActiveMemory\fR, name of the file to which memory
296 information will be written.  For \fBTcl_ValidateAllMemory\fR, name of
297 the file from which the call is being made (normally \fB__FILE__\fR).
298 .AP int line in
299 Line number at which the call to \fBTcl_ValidateAllMemory\fR is made
300 (normally \fB__LINE__\fR).
301 .BE
302
303 .SH DESCRIPTION
304 These functions provide access to Tcl memory debugging information.
305 They are only functional when Tcl has been compiled with
306 \fBTCL_MEM_DEBUG\fR defined at compile-time.  When \fBTCL_MEM_DEBUG\fR
307 is not defined, these functions are all no-ops.
308 .PP 
309 \fBTcl_DumpActiveMemory\fR will output a list of all currently
310 allocated memory to the specified file.  The information output for
311 each allocated block of memory is:  starting and ending addresses
312 (excluding guard zone), size, source file where \fBckalloc\fR was
313 called to allocate the block and line number in that file.  It is
314 especially useful to call \fBTcl_DumpActiveMemory\fR after the Tcl
315 interpreter has been deleted.
316 .PP
317 \fBTcl_InitMemory\fR adds the Tcl \fBmemory\fR command to the
318 interpreter given by \fIinterp\fR.  \fBTcl_InitMemory\fR is called
319 by \fBTcl_Main\fR.
320 .PP
321 \fBTcl_ValidateAllMemory\fR forces a validation of the guard zones of
322 all currently allocated blocks of memory.  Normally validation of a
323 block occurs when its freed, unless full validation is enabled, in
324 which case validation of all blocks occurs when \fBckalloc\fR and
325 \fBckfree\fR are called.  This function forces the validation to occur
326 at any point.
327
328 .SH "SEE ALSO"
329 TCL_MEM_DEBUG, memory
330
331 .SH KEYWORDS
332 memory, debug
333
334