Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 1 | <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 — </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis"> |
Daniel Veillard | 7c1206f | 1999-10-14 09:10:25 +0000 | [diff] [blame] | 32 | |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 33 | |
| 34 | |
| 35 | #define <a href="libxml-xmlmemory.html#DEBUG-MEMORY-CAPS">DEBUG_MEMORY</a> |
| 36 | void (<a href="libxml-xmlmemory.html#xmlFreeFunc">*xmlFreeFunc</a>) (void *mem); |
| 37 | void* (<a href="libxml-xmlmemory.html#xmlMallocFunc">*xmlMallocFunc</a>) (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="size-t">size_t</GTKDOCLINK> size); |
| 38 | void* (<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); |
| 40 | char* (<a href="libxml-xmlmemory.html#xmlStrdupFunc">*xmlStrdupFunc</a>) (const char *str); |
| 41 | int <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); |
| 45 | int <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); |
| 49 | int <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); |
| 54 | int <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); |
| 59 | int <a href="libxml-xmlmemory.html#xmlInitMemory">xmlInitMemory</a> (void); |
| 60 | int <a href="libxml-xmlmemory.html#xmlMemUsed">xmlMemUsed</a> (void); |
| 61 | void <a href="libxml-xmlmemory.html#xmlMemDisplay">xmlMemDisplay</a> (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="FILE-CAPS">FILE</GTKDOCLINK> *fp); |
| 62 | void <a href="libxml-xmlmemory.html#xmlMemShow">xmlMemShow</a> (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="FILE-CAPS">FILE</GTKDOCLINK> *fp, |
Daniel Veillard | f3a7358 | 2000-01-05 14:58:39 +0000 | [diff] [blame] | 63 | int nr); |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 64 | void <a href="libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> (void); |
| 65 | void* <a href="libxml-xmlmemory.html#xmlMemMalloc">xmlMemMalloc</a> (<GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="size-t">size_t</GTKDOCLINK> size); |
| 66 | void* <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); |
| 68 | void <a href="libxml-xmlmemory.html#xmlMemFree">xmlMemFree</a> (void *ptr); |
| 69 | char* <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) |
| 74 | void* <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 Veillard | 7c1206f | 1999-10-14 09:10:25 +0000 | [diff] [blame] | 75 | const char *file, |
| 76 | int line); |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 77 | void* <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 Veillard | 7c1206f | 1999-10-14 09:10:25 +0000 | [diff] [blame] | 79 | const char *file, |
| 80 | int line); |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 81 | char* <a href="libxml-xmlmemory.html#xmlMemStrdupLoc">xmlMemStrdupLoc</a> (const char *str, |
Daniel Veillard | 7c1206f | 1999-10-14 09:10:25 +0000 | [diff] [blame] | 82 | const char *file, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 83 | int line); |
| 84 | </pre></div><div class="refsect1" lang="en"><h2>Description</h2><p> |
| 85 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 86 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 88 | DEBUG_MEMORY replaces the allocator with a collect and debug |
Daniel Veillard | 1927409 | 2002-03-25 16:48:03 +0000 | [diff] [blame] | 89 | shell to the libc allocator. |
| 90 | DEBUG_MEMORY should only be activated when debugging |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 91 | libxml 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> |
| 94 | Signature for a <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="free">free</GTKDOCLINK>() implementation.</p><p> |
| 95 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 96 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 97 | </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> |
| 98 | Signature for a <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="malloc">malloc</GTKDOCLINK>() implementation.</p><p> |
| 99 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 100 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 101 | </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> |
| 103 | Signature for a <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="realloc">realloc</GTKDOCLINK>() implementation.</p><p> |
| 104 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 105 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 107 | </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> |
| 108 | Signature for an <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="strdup">strdup</GTKDOCLINK>() implementation.</p><p> |
| 109 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 110 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 112 | </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> |
| 116 | Override the default memory access functions with a new set |
| 117 | This has to be called before any other libxml routines ! |
| 118 | </p><p> |
| 119 | Should this be blocked if there was already some allocations |
| 120 | done ?</p><p> |
| 121 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 122 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 127 | </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> |
| 131 | Provides the memory access functions set currently in use</p><p> |
| 132 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 133 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 138 | </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> |
| 143 | Override the default memory access functions with a new set |
| 144 | This has to be called before any other libxml routines ! |
| 145 | The mallocAtomicFunc is specialized for atomic block |
| 146 | allocations (i.e. of areas useful for garbage collected memory allocators |
| 147 | </p><p> |
| 148 | Should this be blocked if there was already some allocations |
| 149 | done ?</p><p> |
| 150 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 151 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 157 | </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> |
| 162 | Provides the memory access functions set currently in use |
| 163 | The mallocAtomicFunc is specialized for atomic block |
| 164 | allocations (i.e. of areas useful for garbage collected memory allocators</p><p> |
| 165 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 166 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 172 | </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> |
| 173 | Initialize the memory layer.</p><p> |
| 174 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 175 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 176 | </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> |
| 177 | Provides the amount of memory currently allocated</p><p> |
| 178 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 179 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 180 | </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> |
| 181 | show in-extenso the memory blocks allocated</p><p> |
| 182 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 183 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 185 | </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> |
| 187 | show a show display of the memory allocated, and dump |
| 188 | the <i><tt>nr</tt></i> last allocated areas which were not freed</p><p> |
| 189 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 190 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 192 | </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> |
| 193 | Dump 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> |
| 196 | a <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="malloc">malloc</GTKDOCLINK>() equivalent, with logging of the allocation info.</p><p> |
| 197 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 198 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 199 | </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> |
| 201 | a <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="realloc">realloc</GTKDOCLINK>() equivalent, with logging of the allocation info.</p><p> |
| 202 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 203 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 205 | </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> |
| 206 | a <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="free">free</GTKDOCLINK>() equivalent, with error checking.</p><p> |
| 207 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 208 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 209 | </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> |
| 210 | a <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="strdup">strdup</GTKDOCLINK>() equivalent, with logging of the allocation info.</p><p> |
| 211 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 212 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 214 | </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> |
| 215 | Wrapper 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 Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 217 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 218 | </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> |
| 219 | Wrapper for the <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="malloc">malloc</GTKDOCLINK>() function used in the XML library for allocation |
| 220 | of block not containing pointers to other areas.</p><p> |
| 221 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 222 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 223 | </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> |
| 224 | Wrapper 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 Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 226 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 228 | </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> |
| 229 | Wrapper 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 Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 231 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 232 | </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 Veillard | 7c1206f | 1999-10-14 09:10:25 +0000 | [diff] [blame] | 233 | const char *file, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 234 | int line);</pre><p> |
| 235 | a <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="malloc">malloc</GTKDOCLINK>() equivalent, with logging of the allocation info.</p><p> |
| 236 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 237 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 240 | </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 Veillard | 7c1206f | 1999-10-14 09:10:25 +0000 | [diff] [blame] | 242 | const char *file, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 243 | int line);</pre><p> |
| 244 | a <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="realloc">realloc</GTKDOCLINK>() equivalent, with logging of the allocation info.</p><p> |
| 245 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 246 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 250 | </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 Veillard | 7c1206f | 1999-10-14 09:10:25 +0000 | [diff] [blame] | 251 | const char *file, |
Daniel Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 252 | int line);</pre><p> |
| 253 | a <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="strdup">strdup</GTKDOCLINK>() equivalent, with logging of the allocation info.</p><p> |
| 254 | |
Daniel Veillard | d7cec92 | 2003-06-13 12:30:10 +0000 | [diff] [blame^] | 255 | </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 Veillard | d433046 | 2003-04-29 12:40:16 +0000 | [diff] [blame] | 259 | </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><< debugXML</b></a></td><td align="right"><a accesskey="n" href="libxml-xmlregexp.html"><b>xmlregexp >></b></a></td></tr></table></body></html> |