blob: a79409c028b1927d6e8ca199e8e3289ced63af7f [file] [log] [blame]
Daniel Veillardd4330462003-04-29 12:40:16 +00001<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>xmlmemory</title><meta name="generator" content="DocBook XSL Stylesheets V1.58.1"><style xmlns="http://www.w3.org/TR/xhtml1/transitional" type="text/css">
2 .synopsis, .classsynopsis {
3 background: #eeeeee;
4 border: solid 1px #aaaaaa;
5 padding: 0.5em;
6 }
7 .programlisting {
8 background: #eeeeff;
9 border: solid 1px #aaaaff;
10 padding: 0.5em;
11 }
12 .variablelist {
13 padding: 4px;
14 margin-left: 3em;
15 }
16 .navigation {
17 background: #ffeeee;
18 border: solid 1px #ffaaaa;
19 margin-top: 0.5em;
20 margin-bottom: 0.5em;
21 }
22 .navigation a {
23 color: #770000;
24 }
25 .navigation a:visited {
26 color: #550000;
27 }
28 .navigation .title {
29 font-size: 200%;
30 }
31 </style><link rel="home" href="index.html" title="Gnome XML Library Reference Manual"><link rel="up" href="libxml-lib.html" title="Libxml Library Reference"><link rel="previous" href="libxml-debugXML.html" title="debugXML"><link rel="next" href="libxml-xmlregexp.html" title="xmlregexp"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-debugXML.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></img></a></td><td><a accesskey="u" href="libxml-lib.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></img></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></img></a></td><th width="100%" align="center">Gnome XML Library Reference Manual</th><td><a accesskey="n" href="libxml-xmlregexp.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></img></a></td></tr></table><div class="refentry" lang="en"><a name="libxml-xmlmemory"></a><div class="titlepage"></div><div class="refnamediv"><h2>xmlmemory</h2><p>xmlmemory &#8212; </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
Daniel Veillard7c1206f1999-10-14 09:10:25 +000032
Daniel Veillardd4330462003-04-29 12:40:16 +000033
34
35#define <a href="libxml-xmlmemory.html#DEBUG-MEMORY-CAPS">DEBUG_MEMORY</a>
36void (<a href="libxml-xmlmemory.html#xmlFreeFunc">*xmlFreeFunc</a>) (void *mem);
37void* (<a href="libxml-xmlmemory.html#xmlMallocFunc">*xmlMallocFunc</a>) (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="size-t">size_t</GTKDOCLINK> size);
38void* (<a href="libxml-xmlmemory.html#xmlReallocFunc">*xmlReallocFunc</a>) (void *mem,
39 <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="size-t">size_t</GTKDOCLINK> size);
40char* (<a href="libxml-xmlmemory.html#xmlStrdupFunc">*xmlStrdupFunc</a>) (const char *str);
41int <a href="libxml-xmlmemory.html#xmlMemSetup">xmlMemSetup</a> (<a href="libxml-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> freeFunc,
42 <a href="libxml-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> mallocFunc,
43 <a href="libxml-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> reallocFunc,
44 <a href="libxml-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> strdupFunc);
45int <a href="libxml-xmlmemory.html#xmlMemGet">xmlMemGet</a> (<a href="libxml-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> *freeFunc,
46 <a href="libxml-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> *mallocFunc,
47 <a href="libxml-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> *reallocFunc,
48 <a href="libxml-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> *strdupFunc);
49int <a href="libxml-xmlmemory.html#xmlGcMemSetup">xmlGcMemSetup</a> (<a href="libxml-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> freeFunc,
50 <a href="libxml-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> mallocFunc,
51 <a href="libxml-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> mallocAtomicFunc,
52 <a href="libxml-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> reallocFunc,
53 <a href="libxml-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> strdupFunc);
54int <a href="libxml-xmlmemory.html#xmlGcMemGet">xmlGcMemGet</a> (<a href="libxml-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> *freeFunc,
55 <a href="libxml-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> *mallocFunc,
56 <a href="libxml-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> *mallocAtomicFunc,
57 <a href="libxml-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> *reallocFunc,
58 <a href="libxml-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> *strdupFunc);
59int <a href="libxml-xmlmemory.html#xmlInitMemory">xmlInitMemory</a> (void);
60int <a href="libxml-xmlmemory.html#xmlMemUsed">xmlMemUsed</a> (void);
61void <a href="libxml-xmlmemory.html#xmlMemDisplay">xmlMemDisplay</a> (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="FILE-CAPS">FILE</GTKDOCLINK> *fp);
62void <a href="libxml-xmlmemory.html#xmlMemShow">xmlMemShow</a> (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="FILE-CAPS">FILE</GTKDOCLINK> *fp,
Daniel Veillardf3a73582000-01-05 14:58:39 +000063 int nr);
Daniel Veillardd4330462003-04-29 12:40:16 +000064void <a href="libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> (void);
65void* <a href="libxml-xmlmemory.html#xmlMemMalloc">xmlMemMalloc</a> (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="size-t">size_t</GTKDOCLINK> size);
66void* <a href="libxml-xmlmemory.html#xmlMemRealloc">xmlMemRealloc</a> (void *ptr,
67 <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="size-t">size_t</GTKDOCLINK> size);
68void <a href="libxml-xmlmemory.html#xmlMemFree">xmlMemFree</a> (void *ptr);
69char* <a href="libxml-xmlmemory.html#xmlMemoryStrdup">xmlMemoryStrdup</a> (const char *str);
70#define <a href="libxml-globals.html#xmlMalloc">xmlMalloc</a> (size)
71#define <a href="libxml-globals.html#xmlMallocAtomic">xmlMallocAtomic</a> (size)
72#define <a href="libxml-globals.html#xmlRealloc">xmlRealloc</a> (ptr, size)
73#define <a href="libxml-globals.html#xmlMemStrdup">xmlMemStrdup</a> (str)
74void* <a href="libxml-xmlmemory.html#xmlMallocLoc">xmlMallocLoc</a> (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="size-t">size_t</GTKDOCLINK> size,
Daniel Veillard7c1206f1999-10-14 09:10:25 +000075 const char *file,
76 int line);
Daniel Veillardd4330462003-04-29 12:40:16 +000077void* <a href="libxml-xmlmemory.html#xmlReallocLoc">xmlReallocLoc</a> (void *ptr,
78 <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="size-t">size_t</GTKDOCLINK> size,
Daniel Veillard7c1206f1999-10-14 09:10:25 +000079 const char *file,
80 int line);
Daniel Veillardd4330462003-04-29 12:40:16 +000081char* <a href="libxml-xmlmemory.html#xmlMemStrdupLoc">xmlMemStrdupLoc</a> (const char *str,
Daniel Veillard7c1206f1999-10-14 09:10:25 +000082 const char *file,
Daniel Veillardd4330462003-04-29 12:40:16 +000083 int line);
84</pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
85
Daniel Veillardd7cec922003-06-13 12:30:10 +000086</p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="DEBUG-MEMORY-CAPS"></a>DEBUG_MEMORY</h3><pre class="programlisting">#define DEBUG_MEMORY
87</pre><p>
Daniel Veillardd4330462003-04-29 12:40:16 +000088DEBUG_MEMORY replaces the allocator with a collect and debug
Daniel Veillard19274092002-03-25 16:48:03 +000089shell to the libc allocator.
90DEBUG_MEMORY should only be activated when debugging
Daniel Veillardd4330462003-04-29 12:40:16 +000091libxml i.e. if libxml has been configured with --with-debug-mem too.</p><p>
92
93</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlFreeFunc"></a>xmlFreeFunc ()</h3><pre class="programlisting">void (*xmlFreeFunc) (void *mem);</pre><p>
94Signature for a <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="free">free</GTKDOCLINK>() implementation.</p><p>
95
Daniel Veillardd7cec922003-06-13 12:30:10 +000096</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>mem</tt></i> :</span></td><td> an already allocated block of memory
Daniel Veillardd4330462003-04-29 12:40:16 +000097</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlMallocFunc"></a>xmlMallocFunc ()</h3><pre class="programlisting">void* (*xmlMallocFunc) (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="size-t">size_t</GTKDOCLINK> size);</pre><p>
98Signature for a <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="malloc">malloc</GTKDOCLINK>() implementation.</p><p>
99
Daniel Veillardd7cec922003-06-13 12:30:10 +0000100</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>size</tt></i> :</span></td><td> the size requested in bytes
Daniel Veillardd4330462003-04-29 12:40:16 +0000101</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlReallocFunc"></a>xmlReallocFunc ()</h3><pre class="programlisting">void* (*xmlReallocFunc) (void *mem,
102 <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="size-t">size_t</GTKDOCLINK> size);</pre><p>
103Signature for a <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="realloc">realloc</GTKDOCLINK>() implementation.</p><p>
104
Daniel Veillardd7cec922003-06-13 12:30:10 +0000105</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>mem</tt></i> :</span></td><td> an already allocated block of memory
106</td></tr><tr><td><span class="term"><i><tt>size</tt></i> :</span></td><td> the new size requested in bytes
Daniel Veillardd4330462003-04-29 12:40:16 +0000107</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlStrdupFunc"></a>xmlStrdupFunc ()</h3><pre class="programlisting">char* (*xmlStrdupFunc) (const char *str);</pre><p>
108Signature for an <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="strdup">strdup</GTKDOCLINK>() implementation.</p><p>
109
Daniel Veillardd7cec922003-06-13 12:30:10 +0000110</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>str</tt></i> :</span></td><td> a zero terminated string
111</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the copy of the string or NULL in case of error.
Daniel Veillardd4330462003-04-29 12:40:16 +0000112</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlMemSetup"></a>xmlMemSetup ()</h3><pre class="programlisting">int xmlMemSetup (<a href="libxml-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> freeFunc,
113 <a href="libxml-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> mallocFunc,
114 <a href="libxml-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> reallocFunc,
115 <a href="libxml-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> strdupFunc);</pre><p>
116Override the default memory access functions with a new set
117This has to be called before any other libxml routines !
118</p><p>
119Should this be blocked if there was already some allocations
120done ?</p><p>
121
Daniel Veillardd7cec922003-06-13 12:30:10 +0000122</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>freeFunc</tt></i> :</span></td><td> the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="free">free</GTKDOCLINK>() function to use
123</td></tr><tr><td><span class="term"><i><tt>mallocFunc</tt></i> :</span></td><td> the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="malloc">malloc</GTKDOCLINK>() function to use
124</td></tr><tr><td><span class="term"><i><tt>reallocFunc</tt></i> :</span></td><td> the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="realloc">realloc</GTKDOCLINK>() function to use
125</td></tr><tr><td><span class="term"><i><tt>strdupFunc</tt></i> :</span></td><td> the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="strdup">strdup</GTKDOCLINK>() function to use
126</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 on success
Daniel Veillardd4330462003-04-29 12:40:16 +0000127</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlMemGet"></a>xmlMemGet ()</h3><pre class="programlisting">int xmlMemGet (<a href="libxml-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> *freeFunc,
128 <a href="libxml-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> *mallocFunc,
129 <a href="libxml-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> *reallocFunc,
130 <a href="libxml-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> *strdupFunc);</pre><p>
131Provides the memory access functions set currently in use</p><p>
132
Daniel Veillardd7cec922003-06-13 12:30:10 +0000133</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>freeFunc</tt></i> :</span></td><td> place to save the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="free">free</GTKDOCLINK>() function in use
134</td></tr><tr><td><span class="term"><i><tt>mallocFunc</tt></i> :</span></td><td> place to save the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="malloc">malloc</GTKDOCLINK>() function in use
135</td></tr><tr><td><span class="term"><i><tt>reallocFunc</tt></i> :</span></td><td> place to save the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="realloc">realloc</GTKDOCLINK>() function in use
136</td></tr><tr><td><span class="term"><i><tt>strdupFunc</tt></i> :</span></td><td> place to save the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="strdup">strdup</GTKDOCLINK>() function in use
137</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 on success
Daniel Veillardd4330462003-04-29 12:40:16 +0000138</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlGcMemSetup"></a>xmlGcMemSetup ()</h3><pre class="programlisting">int xmlGcMemSetup (<a href="libxml-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> freeFunc,
139 <a href="libxml-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> mallocFunc,
140 <a href="libxml-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> mallocAtomicFunc,
141 <a href="libxml-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> reallocFunc,
142 <a href="libxml-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> strdupFunc);</pre><p>
143Override the default memory access functions with a new set
144This has to be called before any other libxml routines !
145The mallocAtomicFunc is specialized for atomic block
146allocations (i.e. of areas useful for garbage collected memory allocators
147</p><p>
148Should this be blocked if there was already some allocations
149done ?</p><p>
150
Daniel Veillardd7cec922003-06-13 12:30:10 +0000151</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>freeFunc</tt></i> :</span></td><td> the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="free">free</GTKDOCLINK>() function to use
152</td></tr><tr><td><span class="term"><i><tt>mallocFunc</tt></i> :</span></td><td> the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="malloc">malloc</GTKDOCLINK>() function to use
153</td></tr><tr><td><span class="term"><i><tt>mallocAtomicFunc</tt></i> :</span></td><td> the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="malloc">malloc</GTKDOCLINK>() function to use for atomic allocations
154</td></tr><tr><td><span class="term"><i><tt>reallocFunc</tt></i> :</span></td><td> the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="realloc">realloc</GTKDOCLINK>() function to use
155</td></tr><tr><td><span class="term"><i><tt>strdupFunc</tt></i> :</span></td><td> the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="strdup">strdup</GTKDOCLINK>() function to use
156</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 on success
Daniel Veillardd4330462003-04-29 12:40:16 +0000157</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlGcMemGet"></a>xmlGcMemGet ()</h3><pre class="programlisting">int xmlGcMemGet (<a href="libxml-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> *freeFunc,
158 <a href="libxml-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> *mallocFunc,
159 <a href="libxml-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> *mallocAtomicFunc,
160 <a href="libxml-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> *reallocFunc,
161 <a href="libxml-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> *strdupFunc);</pre><p>
162Provides the memory access functions set currently in use
163The mallocAtomicFunc is specialized for atomic block
164allocations (i.e. of areas useful for garbage collected memory allocators</p><p>
165
Daniel Veillardd7cec922003-06-13 12:30:10 +0000166</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>freeFunc</tt></i> :</span></td><td> place to save the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="free">free</GTKDOCLINK>() function in use
167</td></tr><tr><td><span class="term"><i><tt>mallocFunc</tt></i> :</span></td><td> place to save the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="malloc">malloc</GTKDOCLINK>() function in use
168</td></tr><tr><td><span class="term"><i><tt>mallocAtomicFunc</tt></i> :</span></td><td> place to save the atomic <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="malloc">malloc</GTKDOCLINK>() function in use
169</td></tr><tr><td><span class="term"><i><tt>reallocFunc</tt></i> :</span></td><td> place to save the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="realloc">realloc</GTKDOCLINK>() function in use
170</td></tr><tr><td><span class="term"><i><tt>strdupFunc</tt></i> :</span></td><td> place to save the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="strdup">strdup</GTKDOCLINK>() function in use
171</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 on success
Daniel Veillardd4330462003-04-29 12:40:16 +0000172</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlInitMemory"></a>xmlInitMemory ()</h3><pre class="programlisting">int xmlInitMemory (void);</pre><p>
173Initialize the memory layer.</p><p>
174
Daniel Veillardd7cec922003-06-13 12:30:10 +0000175</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 on success
Daniel Veillardd4330462003-04-29 12:40:16 +0000176</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlMemUsed"></a>xmlMemUsed ()</h3><pre class="programlisting">int xmlMemUsed (void);</pre><p>
177Provides the amount of memory currently allocated</p><p>
178
Daniel Veillardd7cec922003-06-13 12:30:10 +0000179</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>an int representing the amount of memory allocated.
Daniel Veillardd4330462003-04-29 12:40:16 +0000180</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlMemDisplay"></a>xmlMemDisplay ()</h3><pre class="programlisting">void xmlMemDisplay (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="FILE-CAPS">FILE</GTKDOCLINK> *fp);</pre><p>
181show in-extenso the memory blocks allocated</p><p>
182
Daniel Veillardd7cec922003-06-13 12:30:10 +0000183</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>fp</tt></i> :</span></td><td> a FILE descriptor used as the output file, if NULL, the result is
184 written to the file .memorylist
Daniel Veillardd4330462003-04-29 12:40:16 +0000185</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlMemShow"></a>xmlMemShow ()</h3><pre class="programlisting">void xmlMemShow (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="FILE-CAPS">FILE</GTKDOCLINK> *fp,
186 int nr);</pre><p>
187show a show display of the memory allocated, and dump
188the <i><tt>nr</tt></i> last allocated areas which were not freed</p><p>
189
Daniel Veillardd7cec922003-06-13 12:30:10 +0000190</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>fp</tt></i> :</span></td><td> a FILE descriptor used as the output file
191</td></tr><tr><td><span class="term"><i><tt>nr</tt></i> :</span></td><td> number of entries to dump
Daniel Veillardd4330462003-04-29 12:40:16 +0000192</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlMemoryDump"></a>xmlMemoryDump ()</h3><pre class="programlisting">void xmlMemoryDump (void);</pre><p>
193Dump in-extenso the memory blocks allocated to the file .memorylist</p><p>
194
195</p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlMemMalloc"></a>xmlMemMalloc ()</h3><pre class="programlisting">void* xmlMemMalloc (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="size-t">size_t</GTKDOCLINK> size);</pre><p>
196a <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="malloc">malloc</GTKDOCLINK>() equivalent, with logging of the allocation info.</p><p>
197
Daniel Veillardd7cec922003-06-13 12:30:10 +0000198</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>size</tt></i> :</span></td><td> an int specifying the size in byte to allocate.
Daniel Veillardd4330462003-04-29 12:40:16 +0000199</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlMemRealloc"></a>xmlMemRealloc ()</h3><pre class="programlisting">void* xmlMemRealloc (void *ptr,
200 <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="size-t">size_t</GTKDOCLINK> size);</pre><p>
201a <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="realloc">realloc</GTKDOCLINK>() equivalent, with logging of the allocation info.</p><p>
202
Daniel Veillardd7cec922003-06-13 12:30:10 +0000203</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ptr</tt></i> :</span></td><td> the initial memory block pointer
204</td></tr><tr><td><span class="term"><i><tt>size</tt></i> :</span></td><td> an int specifying the size in byte to allocate.
Daniel Veillardd4330462003-04-29 12:40:16 +0000205</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlMemFree"></a>xmlMemFree ()</h3><pre class="programlisting">void xmlMemFree (void *ptr);</pre><p>
206a <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="free">free</GTKDOCLINK>() equivalent, with error checking.</p><p>
207
Daniel Veillardd7cec922003-06-13 12:30:10 +0000208</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ptr</tt></i> :</span></td><td> the memory block pointer
Daniel Veillardd4330462003-04-29 12:40:16 +0000209</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlMemoryStrdup"></a>xmlMemoryStrdup ()</h3><pre class="programlisting">char* xmlMemoryStrdup (const char *str);</pre><p>
210a <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="strdup">strdup</GTKDOCLINK>() equivalent, with logging of the allocation info.</p><p>
211
Daniel Veillardd7cec922003-06-13 12:30:10 +0000212</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>str</tt></i> :</span></td><td> the initial string pointer
213</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a pointer to the new string or NULL if allocation error occurred.
Daniel Veillardd4330462003-04-29 12:40:16 +0000214</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlMalloc"></a>xmlMalloc()</h3><pre class="programlisting">#define xmlMalloc(size)</pre><p>
215Wrapper for the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="malloc">malloc</GTKDOCLINK>() function used in the XML library.</p><p>
216
Daniel Veillardd7cec922003-06-13 12:30:10 +0000217</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>size</tt></i> :</span></td><td> number of bytes to allocate
Daniel Veillardd4330462003-04-29 12:40:16 +0000218</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlMallocAtomic"></a>xmlMallocAtomic()</h3><pre class="programlisting">#define xmlMallocAtomic(size)</pre><p>
219Wrapper for the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="malloc">malloc</GTKDOCLINK>() function used in the XML library for allocation
220of block not containing pointers to other areas.</p><p>
221
Daniel Veillardd7cec922003-06-13 12:30:10 +0000222</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>size</tt></i> :</span></td><td> number of bytes to allocate
Daniel Veillardd4330462003-04-29 12:40:16 +0000223</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlRealloc"></a>xmlRealloc()</h3><pre class="programlisting">#define xmlRealloc(ptr, size)</pre><p>
224Wrapper for the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="realloc">realloc</GTKDOCLINK>() function used in the XML library.</p><p>
225
Daniel Veillardd7cec922003-06-13 12:30:10 +0000226</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ptr</tt></i> :</span></td><td> pointer to the existing allocated area
227</td></tr><tr><td><span class="term"><i><tt>size</tt></i> :</span></td><td> number of bytes to allocate
Daniel Veillardd4330462003-04-29 12:40:16 +0000228</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlMemStrdup"></a>xmlMemStrdup()</h3><pre class="programlisting">#define xmlMemStrdup(str)</pre><p>
229Wrapper for the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="strdup">strdup</GTKDOCLINK>() function, <a href="libxml-parser.html#xmlStrdup">xmlStrdup</a>() is usually preferred.</p><p>
230
Daniel Veillardd7cec922003-06-13 12:30:10 +0000231</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>str</tt></i> :</span></td><td> pointer to the existing string
Daniel Veillardd4330462003-04-29 12:40:16 +0000232</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlMallocLoc"></a>xmlMallocLoc ()</h3><pre class="programlisting">void* xmlMallocLoc (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="size-t">size_t</GTKDOCLINK> size,
Daniel Veillard7c1206f1999-10-14 09:10:25 +0000233 const char *file,
Daniel Veillardd4330462003-04-29 12:40:16 +0000234 int line);</pre><p>
235a <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="malloc">malloc</GTKDOCLINK>() equivalent, with logging of the allocation info.</p><p>
236
Daniel Veillardd7cec922003-06-13 12:30:10 +0000237</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>size</tt></i> :</span></td><td> an int specifying the size in byte to allocate.
238</td></tr><tr><td><span class="term"><i><tt>file</tt></i> :</span></td><td> the file name or NULL
239</td></tr><tr><td><span class="term"><i><tt>line</tt></i> :</span></td><td> the line number
Daniel Veillardd4330462003-04-29 12:40:16 +0000240</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlReallocLoc"></a>xmlReallocLoc ()</h3><pre class="programlisting">void* xmlReallocLoc (void *ptr,
241 <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="size-t">size_t</GTKDOCLINK> size,
Daniel Veillard7c1206f1999-10-14 09:10:25 +0000242 const char *file,
Daniel Veillardd4330462003-04-29 12:40:16 +0000243 int line);</pre><p>
244a <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="realloc">realloc</GTKDOCLINK>() equivalent, with logging of the allocation info.</p><p>
245
Daniel Veillardd7cec922003-06-13 12:30:10 +0000246</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ptr</tt></i> :</span></td><td> the initial memory block pointer
247</td></tr><tr><td><span class="term"><i><tt>size</tt></i> :</span></td><td> an int specifying the size in byte to allocate.
248</td></tr><tr><td><span class="term"><i><tt>file</tt></i> :</span></td><td> the file name or NULL
249</td></tr><tr><td><span class="term"><i><tt>line</tt></i> :</span></td><td> the line number
Daniel Veillardd4330462003-04-29 12:40:16 +0000250</td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlMemStrdupLoc"></a>xmlMemStrdupLoc ()</h3><pre class="programlisting">char* xmlMemStrdupLoc (const char *str,
Daniel Veillard7c1206f1999-10-14 09:10:25 +0000251 const char *file,
Daniel Veillardd4330462003-04-29 12:40:16 +0000252 int line);</pre><p>
253a <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="strdup">strdup</GTKDOCLINK>() equivalent, with logging of the allocation info.</p><p>
254
Daniel Veillardd7cec922003-06-13 12:30:10 +0000255</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>str</tt></i> :</span></td><td> the initial string pointer
256</td></tr><tr><td><span class="term"><i><tt>file</tt></i> :</span></td><td> the file name or NULL
257</td></tr><tr><td><span class="term"><i><tt>line</tt></i> :</span></td><td> the line number
258</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a pointer to the new string or NULL if allocation error occurred.
Daniel Veillardd4330462003-04-29 12:40:16 +0000259</td></tr></tbody></table></div></div></div></div><table xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="libxml-debugXML.html"><b>&lt;&lt; debugXML</b></a></td><td align="right"><a accesskey="n" href="libxml-xmlregexp.html"><b>xmlregexp &gt;&gt;</b></a></td></tr></table></body></html>