📄 libxml2-xmlmemory.html
字号:
<?xml version="1.0" encoding="UTF-8"?><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>xmlmemory: interface for the memory allocator</title> <meta name="generator" content="Libxml2 devhelp stylesheet"/> <link rel="start" href="index.html" title="libxml2 Reference Manual"/> <link rel="up" href="general.html" title="API"/> <link rel="stylesheet" href="style.css" type="text/css"/> <link rel="chapter" href="general.html" title="API"/> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"> <tr valign="middle"> <td> <a accesskey="p" href="libxml2-xmlexports.html"> <img src="left.png" width="24" height="24" border="0" alt="Prev"/> </a> </td> <td> <a accesskey="u" href="general.html"> <img src="up.png" width="24" height="24" border="0" alt="Up"/> </a> </td> <td> <a accesskey="h" href="index.html"> <img src="home.png" width="24" height="24" border="0" alt="Home"/> </a> </td> <td> <a accesskey="n" href="libxml2-xmlmodule.html"> <img src="right.png" width="24" height="24" border="0" alt="Next"/> </a> </td> <th width="100%" align="center">libxml2 Reference Manual</th> </tr> </table> <h2> <span class="refentrytitle">xmlmemory</span> </h2> <p>xmlmemory - interface for the memory allocator</p> <p>provides interfaces for the memory allocator, including debugging capabilities. </p> <p>Author(s): Daniel Veillard </p> <div class="refsynopsisdiv"> <h2>Synopsis</h2> <pre class="synopsis">#define <a href="#xmlRealloc">xmlRealloc</a>;#define <a href="#xmlMalloc">xmlMalloc</a>;#define <a href="#xmlMallocAtomic">xmlMallocAtomic</a>;#define <a href="#DEBUG_MEMORY">DEBUG_MEMORY</a>;#define <a href="#xmlMemStrdup">xmlMemStrdup</a>;void * <a href="#xmlMemRealloc">xmlMemRealloc</a> (void * ptr, <br/> size_t size);int <a href="#xmlInitMemory">xmlInitMemory</a> (void);void <a href="#xmlMemFree">xmlMemFree</a> (void * ptr);void * <a href="#xmlMemMalloc">xmlMemMalloc</a> (size_t size);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);void <a href="#xmlMemoryDump">xmlMemoryDump</a> (void);void * <a href="#xmlMallocLoc">xmlMallocLoc</a> (size_t size, <br/> const char * file, <br/> int line);void <a href="#xmlMemDisplay">xmlMemDisplay</a> (FILE * fp);int <a href="#xmlMemBlocks">xmlMemBlocks</a> (void);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);typedef char * <a href="#xmlStrdupFunc">xmlStrdupFunc</a> (const char * str);typedef void <a href="#xmlFreeFunc">xmlFreeFunc</a> (void * mem);void <a href="#xmlMemShow">xmlMemShow</a> (FILE * fp, <br/> int nr);void * <a href="#xmlMallocAtomicLoc">xmlMallocAtomicLoc</a> (size_t size, <br/> const char * file, <br/> int line);void * <a href="#xmlReallocLoc">xmlReallocLoc</a> (void * ptr, <br/> size_t size, <br/> const char * file, <br/> int line);void <a href="#xmlCleanupMemory">xmlCleanupMemory</a> (void);int <a href="#xmlMemUsed">xmlMemUsed</a> (void);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);typedef void * <a href="#xmlReallocFunc">xmlReallocFunc</a> (void * mem, <br/> size_t size);typedef void * <a href="#xmlMallocFunc">xmlMallocFunc</a> (size_t size);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);char * <a href="#xmlMemoryStrdup">xmlMemoryStrdup</a> (const char * str);char * <a href="#xmlMemStrdupLoc">xmlMemStrdupLoc</a> (const char * str, <br/> const char * file, <br/> int line);</pre> </div> <div class="refsect1" lang="en"> <h2>Description</h2> </div> <div class="refsect1" lang="en"> <h2>Details</h2> <div class="refsect2" lang="en"> <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>;</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></div> <hr/> <div class="refsect2" lang="en"><h3><a name="xmlFreeFunc"/>Function type xmlFreeFunc</h3><pre class="programlisting">void xmlFreeFunc (void * mem)<br/></pre><p>Signature for a free() implementation.</p><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> <hr/> <div class="refsect2" lang="en"><h3><a name="xmlMallocFunc"/>Function type xmlMallocFunc</h3><pre class="programlisting">void * xmlMallocFunc (size_t size)<br/></pre><p>Signature for a malloc() implementation.</p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -