| Daniel Veillard | 1db4a66 | 2005-09-12 13:10:09 +0000 | [diff] [blame^] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <html> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
| 5 | <title>xmlmemory: interface for the memory allocator</title> |
| 6 | <meta name="generator" content="Libxml2 devhelp stylesheet"/> |
| 7 | <link rel="start" href="index.html" title="libxml2 Reference Manual"/> |
| 8 | <link rel="up" href="general.html" title="API"/> |
| 9 | <link rel="stylesheet" href="style.css" type="text/css"/> |
| 10 | <link rel="chapter" href="general.html" title="API"/> |
| 11 | </head> |
| 12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
| 13 | <table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"> |
| 14 | <tr valign="middle"> |
| 15 | <td> |
| 16 | <a accesskey="p" href="libxml2-xmlexports.html"> |
| 17 | <img src="left.png" width="24" height="24" border="0" alt="Prev"/> |
| 18 | </a> |
| 19 | </td> |
| 20 | <td> |
| 21 | <a accesskey="u" href="general.html"> |
| 22 | <img src="up.png" width="24" height="24" border="0" alt="Up"/> |
| 23 | </a> |
| 24 | </td> |
| 25 | <td> |
| 26 | <a accesskey="h" href="index.html"> |
| 27 | <img src="home.png" width="24" height="24" border="0" alt="Home"/> |
| 28 | </a> |
| 29 | </td> |
| 30 | <td> |
| 31 | <a accesskey="n" href="libxml2-xmlmodule.html"> |
| 32 | <img src="right.png" width="24" height="24" border="0" alt="Next"/> |
| 33 | </a> |
| 34 | </td> |
| 35 | <th width="100%" align="center">libxml2 Reference Manual</th> |
| 36 | </tr> |
| 37 | </table> |
| 38 | <h2> |
| 39 | <span class="refentrytitle">xmlmemory</span> |
| 40 | </h2> |
| 41 | <p>xmlmemory - interface for the memory allocator</p> |
| 42 | <p>provides interfaces for the memory allocator, including debugging capabilities. </p> |
| 43 | <p>Author(s): Daniel Veillard </p> |
| 44 | <div class="refsynopsisdiv"> |
| 45 | <h2>Synopsis</h2> |
| 46 | <pre class="synopsis">#define <a href="#xmlRealloc">xmlRealloc</a>; |
| 47 | #define <a href="#xmlMalloc">xmlMalloc</a>; |
| 48 | #define <a href="#xmlMallocAtomic">xmlMallocAtomic</a>; |
| 49 | #define <a href="#DEBUG_MEMORY">DEBUG_MEMORY</a>; |
| 50 | #define <a href="#xmlMemStrdup">xmlMemStrdup</a>; |
| 51 | void * <a href="#xmlMemRealloc">xmlMemRealloc</a> (void * ptr, <br/> size_t size); |
| 52 | int <a href="#xmlInitMemory">xmlInitMemory</a> (void); |
| 53 | void <a href="#xmlMemFree">xmlMemFree</a> (void * ptr); |
| 54 | void * <a href="#xmlMemMalloc">xmlMemMalloc</a> (size_t size); |
| 55 | int <a href="#xmlMemGet">xmlMemGet</a> (<a href="libxml2-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> * freeFunc, <br/> <a href="libxml2-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> * mallocFunc, <br/> <a href="libxml2-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> * reallocFunc, <br/> <a href="libxml2-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> * strdupFunc); |
| 56 | void <a href="#xmlMemoryDump">xmlMemoryDump</a> (void); |
| 57 | void * <a href="#xmlMallocLoc">xmlMallocLoc</a> (size_t size, <br/> const char * file, <br/> int line); |
| 58 | void <a href="#xmlMemDisplay">xmlMemDisplay</a> (FILE * fp); |
| 59 | int <a href="#xmlMemBlocks">xmlMemBlocks</a> (void); |
| 60 | int <a href="#xmlGcMemGet">xmlGcMemGet</a> (<a href="libxml2-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> * freeFunc, <br/> <a href="libxml2-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> * mallocFunc, <br/> <a href="libxml2-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> * mallocAtomicFunc, <br/> <a href="libxml2-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> * reallocFunc, <br/> <a href="libxml2-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> * strdupFunc); |
| 61 | typedef char * <a href="#xmlStrdupFunc">xmlStrdupFunc</a> (const char * str); |
| 62 | typedef void <a href="#xmlFreeFunc">xmlFreeFunc</a> (void * mem); |
| 63 | void <a href="#xmlMemShow">xmlMemShow</a> (FILE * fp, <br/> int nr); |
| 64 | void * <a href="#xmlMallocAtomicLoc">xmlMallocAtomicLoc</a> (size_t size, <br/> const char * file, <br/> int line); |
| 65 | void * <a href="#xmlReallocLoc">xmlReallocLoc</a> (void * ptr, <br/> size_t size, <br/> const char * file, <br/> int line); |
| 66 | void <a href="#xmlCleanupMemory">xmlCleanupMemory</a> (void); |
| 67 | int <a href="#xmlMemUsed">xmlMemUsed</a> (void); |
| 68 | int <a href="#xmlMemSetup">xmlMemSetup</a> (<a href="libxml2-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> freeFunc, <br/> <a href="libxml2-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> mallocFunc, <br/> <a href="libxml2-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> reallocFunc, <br/> <a href="libxml2-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> strdupFunc); |
| 69 | typedef void * <a href="#xmlReallocFunc">xmlReallocFunc</a> (void * mem, <br/> size_t size); |
| 70 | typedef void * <a href="#xmlMallocFunc">xmlMallocFunc</a> (size_t size); |
| 71 | int <a href="#xmlGcMemSetup">xmlGcMemSetup</a> (<a href="libxml2-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> freeFunc, <br/> <a href="libxml2-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> mallocFunc, <br/> <a href="libxml2-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> mallocAtomicFunc, <br/> <a href="libxml2-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> reallocFunc, <br/> <a href="libxml2-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> strdupFunc); |
| 72 | char * <a href="#xmlMemoryStrdup">xmlMemoryStrdup</a> (const char * str); |
| 73 | char * <a href="#xmlMemStrdupLoc">xmlMemStrdupLoc</a> (const char * str, <br/> const char * file, <br/> int line); |
| 74 | </pre> |
| 75 | </div> |
| 76 | <div class="refsect1" lang="en"> |
| 77 | <h2>Description</h2> |
| 78 | </div> |
| 79 | <div class="refsect1" lang="en"> |
| 80 | <h2>Details</h2> |
| 81 | <div class="refsect2" lang="en"> |
| 82 | <div class="refsect2" lang="en"><h3><a name="DEBUG_MEMORY">Macro </a>DEBUG_MEMORY</h3><pre class="programlisting">#define <a href="#DEBUG_MEMORY">DEBUG_MEMORY</a>; |
| 83 | </pre><p><a href="libxml2-xmlmemory.html#DEBUG_MEMORY">DEBUG_MEMORY</a> replaces the allocator with a collect and debug shell to the libc allocator. <a href="libxml2-xmlmemory.html#DEBUG_MEMORY">DEBUG_MEMORY</a> should only be activated when debugging libxml i.e. if libxml has been configured with --with-debug-mem too. #define DEBUG_MEMORY_FREED #define <a href="libxml2-xmlversion.html#DEBUG_MEMORY_LOCATION">DEBUG_MEMORY_LOCATION</a></p> |
| 84 | </div> |
| 85 | <hr/> |
| 86 | <div class="refsect2" lang="en"><h3><a name="xmlFreeFunc"/>Function type xmlFreeFunc</h3><pre class="programlisting">void xmlFreeFunc (void * mem)<br/> |
| 87 | </pre><p>Signature for a free() implementation.</p> |
| 88 | <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>mem</tt></i>:</span></td><td>an already allocated block of memory</td></tr></tbody></table></div></div> |
| 89 | <hr/> |
| 90 | <div class="refsect2" lang="en"><h3><a name="xmlMallocFunc"/>Function type xmlMallocFunc</h3><pre class="programlisting">void * xmlMallocFunc (size_t size)<br/> |
| 91 | </pre><p>Signature for a malloc() implementation.</p> |
| 92 | <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>the size requested in bytes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the newly allocated block or NULL in case of error.</td></tr></tbody></table></div></div> |
| 93 | <hr/> |
| 94 | <div class="refsect2" lang="en"><h3><a name="xmlReallocFunc"/>Function type xmlReallocFunc</h3><pre class="programlisting">void * xmlReallocFunc (void * mem, <br/> size_t size)<br/> |
| 95 | </pre><p>Signature for a realloc() implementation.</p> |
| 96 | <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>mem</tt></i>:</span></td><td>an already allocated block of memory</td></tr><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>the new size requested in bytes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the newly reallocated block or NULL in case of error.</td></tr></tbody></table></div></div> |
| 97 | <hr/> |
| 98 | <div class="refsect2" lang="en"><h3><a name="xmlStrdupFunc"/>Function type xmlStrdupFunc</h3><pre class="programlisting">char * xmlStrdupFunc (const char * str)<br/> |
| 99 | </pre><p>Signature for an strdup() implementation.</p> |
| 100 | <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>a zero terminated string</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the copy of the string or NULL in case of error.</td></tr></tbody></table></div></div> |
| 101 | <hr/> |
| 102 | <div class="refsect2" lang="en"><h3><a name="xmlCleanupMemory"/>xmlCleanupMemory ()</h3><pre class="programlisting">void xmlCleanupMemory (void)<br/> |
| 103 | </pre><p>Free up all the memory allocated by the library for its own use. This should not be called by user level code.</p> |
| 104 | </div> |
| 105 | <hr/> |
| 106 | <div class="refsect2" lang="en"><h3><a name="xmlGcMemGet"/>xmlGcMemGet ()</h3><pre class="programlisting">int xmlGcMemGet (<a href="libxml2-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> * freeFunc, <br/> <a href="libxml2-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> * mallocFunc, <br/> <a href="libxml2-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> * mallocAtomicFunc, <br/> <a href="libxml2-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> * reallocFunc, <br/> <a href="libxml2-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> * strdupFunc)<br/> |
| 107 | </pre><p>Provides the memory access functions set currently in use The mallocAtomicFunc is specialized for atomic block allocations (i.e. of areas useful for garbage collected memory allocators</p> |
| 108 | <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>freeFunc</tt></i>:</span></td><td>place to save the free() function in use</td></tr><tr><td><span class="term"><i><tt>mallocFunc</tt></i>:</span></td><td>place to save the malloc() function in use</td></tr><tr><td><span class="term"><i><tt>mallocAtomicFunc</tt></i>:</span></td><td>place to save the atomic malloc() function in use</td></tr><tr><td><span class="term"><i><tt>reallocFunc</tt></i>:</span></td><td>place to save the realloc() function in use</td></tr><tr><td><span class="term"><i><tt>strdupFunc</tt></i>:</span></td><td>place to save the strdup() function in use</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success</td></tr></tbody></table></div></div> |
| 109 | <hr/> |
| 110 | <div class="refsect2" lang="en"><h3><a name="xmlGcMemSetup"/>xmlGcMemSetup ()</h3><pre class="programlisting">int xmlGcMemSetup (<a href="libxml2-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> freeFunc, <br/> <a href="libxml2-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> mallocFunc, <br/> <a href="libxml2-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> mallocAtomicFunc, <br/> <a href="libxml2-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> reallocFunc, <br/> <a href="libxml2-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> strdupFunc)<br/> |
| 111 | </pre><p>Override the default memory access functions with a new set This has to be called before any other libxml routines ! The mallocAtomicFunc is specialized for atomic block allocations (i.e. of areas useful for garbage collected memory allocators Should this be blocked if there was already some allocations done ?</p> |
| 112 | <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>freeFunc</tt></i>:</span></td><td>the free() function to use</td></tr><tr><td><span class="term"><i><tt>mallocFunc</tt></i>:</span></td><td>the malloc() function to use</td></tr><tr><td><span class="term"><i><tt>mallocAtomicFunc</tt></i>:</span></td><td>the malloc() function to use for atomic allocations</td></tr><tr><td><span class="term"><i><tt>reallocFunc</tt></i>:</span></td><td>the realloc() function to use</td></tr><tr><td><span class="term"><i><tt>strdupFunc</tt></i>:</span></td><td>the strdup() function to use</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success</td></tr></tbody></table></div></div> |
| 113 | <hr/> |
| 114 | <div class="refsect2" lang="en"><h3><a name="xmlInitMemory"/>xmlInitMemory ()</h3><pre class="programlisting">int xmlInitMemory (void)<br/> |
| 115 | </pre><p>Initialize the memory layer.</p> |
| 116 | <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success</td></tr></tbody></table></div></div> |
| 117 | <hr/> |
| 118 | <div class="refsect2" lang="en"><h3><a name="xmlMallocAtomicLoc"/>xmlMallocAtomicLoc ()</h3><pre class="programlisting">void * xmlMallocAtomicLoc (size_t size, <br/> const char * file, <br/> int line)<br/> |
| 119 | </pre><p>a malloc() equivalent, with logging of the allocation info.</p> |
| 120 | <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>an int specifying the size in byte to allocate.</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>the file name or NULL</td></tr><tr><td><span class="term"><i><tt>line</tt></i>:</span></td><td>the line number</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the allocated area or NULL in case of lack of memory.</td></tr></tbody></table></div></div> |
| 121 | <hr/> |
| 122 | <div class="refsect2" lang="en"><h3><a name="xmlMallocLoc"/>xmlMallocLoc ()</h3><pre class="programlisting">void * xmlMallocLoc (size_t size, <br/> const char * file, <br/> int line)<br/> |
| 123 | </pre><p>a malloc() equivalent, with logging of the allocation info.</p> |
| 124 | <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>an int specifying the size in byte to allocate.</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>the file name or NULL</td></tr><tr><td><span class="term"><i><tt>line</tt></i>:</span></td><td>the line number</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the allocated area or NULL in case of lack of memory.</td></tr></tbody></table></div></div> |
| 125 | <hr/> |
| 126 | <div class="refsect2" lang="en"><h3><a name="xmlMemBlocks"/>xmlMemBlocks ()</h3><pre class="programlisting">int xmlMemBlocks (void)<br/> |
| 127 | </pre><p>Provides the number of memory areas currently allocated</p> |
| 128 | <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an int representing the number of blocks</td></tr></tbody></table></div></div> |
| 129 | <hr/> |
| 130 | <div class="refsect2" lang="en"><h3><a name="xmlMemDisplay"/>xmlMemDisplay ()</h3><pre class="programlisting">void xmlMemDisplay (FILE * fp)<br/> |
| 131 | </pre><p>show in-extenso the memory blocks allocated</p> |
| 132 | <div class="variablelist"><table border="0"><col align="left"/><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 written to the file .memorylist</td></tr></tbody></table></div></div> |
| 133 | <hr/> |
| 134 | <div class="refsect2" lang="en"><h3><a name="xmlMemFree"/>xmlMemFree ()</h3><pre class="programlisting">void xmlMemFree (void * ptr)<br/> |
| 135 | </pre><p>a free() equivalent, with error checking.</p> |
| 136 | <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ptr</tt></i>:</span></td><td>the memory block pointer</td></tr></tbody></table></div></div> |
| 137 | <hr/> |
| 138 | <div class="refsect2" lang="en"><h3><a name="xmlMemGet"/>xmlMemGet ()</h3><pre class="programlisting">int xmlMemGet (<a href="libxml2-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> * freeFunc, <br/> <a href="libxml2-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> * mallocFunc, <br/> <a href="libxml2-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> * reallocFunc, <br/> <a href="libxml2-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> * strdupFunc)<br/> |
| 139 | </pre><p>Provides the memory access functions set currently in use</p> |
| 140 | <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>freeFunc</tt></i>:</span></td><td>place to save the free() function in use</td></tr><tr><td><span class="term"><i><tt>mallocFunc</tt></i>:</span></td><td>place to save the malloc() function in use</td></tr><tr><td><span class="term"><i><tt>reallocFunc</tt></i>:</span></td><td>place to save the realloc() function in use</td></tr><tr><td><span class="term"><i><tt>strdupFunc</tt></i>:</span></td><td>place to save the strdup() function in use</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success</td></tr></tbody></table></div></div> |
| 141 | <hr/> |
| 142 | <div class="refsect2" lang="en"><h3><a name="xmlMemMalloc"/>xmlMemMalloc ()</h3><pre class="programlisting">void * xmlMemMalloc (size_t size)<br/> |
| 143 | </pre><p>a malloc() equivalent, with logging of the allocation info.</p> |
| 144 | <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>an int specifying the size in byte to allocate.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the allocated area or NULL in case of lack of memory.</td></tr></tbody></table></div></div> |
| 145 | <hr/> |
| 146 | <div class="refsect2" lang="en"><h3><a name="xmlMemRealloc"/>xmlMemRealloc ()</h3><pre class="programlisting">void * xmlMemRealloc (void * ptr, <br/> size_t size)<br/> |
| 147 | </pre><p>a realloc() equivalent, with logging of the allocation info.</p> |
| 148 | <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ptr</tt></i>:</span></td><td>the initial memory block pointer</td></tr><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>an int specifying the size in byte to allocate.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the allocated area or NULL in case of lack of memory.</td></tr></tbody></table></div></div> |
| 149 | <hr/> |
| 150 | <div class="refsect2" lang="en"><h3><a name="xmlMemSetup"/>xmlMemSetup ()</h3><pre class="programlisting">int xmlMemSetup (<a href="libxml2-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> freeFunc, <br/> <a href="libxml2-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> mallocFunc, <br/> <a href="libxml2-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> reallocFunc, <br/> <a href="libxml2-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> strdupFunc)<br/> |
| 151 | </pre><p>Override the default memory access functions with a new set This has to be called before any other libxml routines ! Should this be blocked if there was already some allocations done ?</p> |
| 152 | <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>freeFunc</tt></i>:</span></td><td>the free() function to use</td></tr><tr><td><span class="term"><i><tt>mallocFunc</tt></i>:</span></td><td>the malloc() function to use</td></tr><tr><td><span class="term"><i><tt>reallocFunc</tt></i>:</span></td><td>the realloc() function to use</td></tr><tr><td><span class="term"><i><tt>strdupFunc</tt></i>:</span></td><td>the strdup() function to use</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success</td></tr></tbody></table></div></div> |
| 153 | <hr/> |
| 154 | <div class="refsect2" lang="en"><h3><a name="xmlMemShow"/>xmlMemShow ()</h3><pre class="programlisting">void xmlMemShow (FILE * fp, <br/> int nr)<br/> |
| 155 | </pre><p>show a show display of the memory allocated, and dump the @nr last allocated areas which were not freed</p> |
| 156 | <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>fp</tt></i>:</span></td><td>a FILE descriptor used as the output file</td></tr><tr><td><span class="term"><i><tt>nr</tt></i>:</span></td><td>number of entries to dump</td></tr></tbody></table></div></div> |
| 157 | <hr/> |
| 158 | <div class="refsect2" lang="en"><h3><a name="xmlMemStrdupLoc"/>xmlMemStrdupLoc ()</h3><pre class="programlisting">char * xmlMemStrdupLoc (const char * str, <br/> const char * file, <br/> int line)<br/> |
| 159 | </pre><p>a strdup() equivalent, with logging of the allocation info.</p> |
| 160 | <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>the initial string pointer</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>the file name or NULL</td></tr><tr><td><span class="term"><i><tt>line</tt></i>:</span></td><td>the line number</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the new string or NULL if allocation error occurred.</td></tr></tbody></table></div></div> |
| 161 | <hr/> |
| 162 | <div class="refsect2" lang="en"><h3><a name="xmlMemUsed"/>xmlMemUsed ()</h3><pre class="programlisting">int xmlMemUsed (void)<br/> |
| 163 | </pre><p>Provides the amount of memory currently allocated</p> |
| 164 | <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an int representing the amount of memory allocated.</td></tr></tbody></table></div></div> |
| 165 | <hr/> |
| 166 | <div class="refsect2" lang="en"><h3><a name="xmlMemoryDump"/>xmlMemoryDump ()</h3><pre class="programlisting">void xmlMemoryDump (void)<br/> |
| 167 | </pre><p>Dump in-extenso the memory blocks allocated to the file .memorylist</p> |
| 168 | </div> |
| 169 | <hr/> |
| 170 | <div class="refsect2" lang="en"><h3><a name="xmlMemoryStrdup"/>xmlMemoryStrdup ()</h3><pre class="programlisting">char * xmlMemoryStrdup (const char * str)<br/> |
| 171 | </pre><p>a strdup() equivalent, with logging of the allocation info.</p> |
| 172 | <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>the initial string pointer</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the new string or NULL if allocation error occurred.</td></tr></tbody></table></div></div> |
| 173 | <hr/> |
| 174 | <div class="refsect2" lang="en"><h3><a name="xmlReallocLoc"/>xmlReallocLoc ()</h3><pre class="programlisting">void * xmlReallocLoc (void * ptr, <br/> size_t size, <br/> const char * file, <br/> int line)<br/> |
| 175 | </pre><p>a realloc() equivalent, with logging of the allocation info.</p> |
| 176 | <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ptr</tt></i>:</span></td><td>the initial memory block pointer</td></tr><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>an int specifying the size in byte to allocate.</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>the file name or NULL</td></tr><tr><td><span class="term"><i><tt>line</tt></i>:</span></td><td>the line number</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the allocated area or NULL in case of lack of memory.</td></tr></tbody></table></div></div> |
| 177 | <hr/> |
| 178 | </div> |
| 179 | </div> |
| 180 | </body> |
| 181 | </html> |