📄 group__apr__pools.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Apache Portable Runtime: Memory Pool Functions</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.7 -->
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
<h1>Memory Pool Functions</h1><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Modules</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>group </td><td class="memItemRight" valign=bottom><a class="el" href="group___pool_debug.html">Pool Debugging functions.</a></td></tr>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga30">APR_POOL_DECLARE_ACCESSOR</a>(type)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga31">APR_POOL_IMPLEMENT_ACCESSOR</a>(type)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga32">APR_POOL_DEBUG</a> 0</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga33">APR_POOL__FILE_LINE__</a> __FILE__ ":" APR_STRINGIFY(__LINE__)</td></tr>
<tr><td colspan=2><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef <a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef int(* </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga1">apr_abortfunc_t</a> )(int retcode)</td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga2">apr_pool_initialize</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga3">apr_pool_terminate</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga4">apr_pool_create_ex</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> **newpool, <a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *parent, <a class="el" href="group__apr__pools.html#ga1">apr_abortfunc_t</a> abort_fn, <a class="el" href="group__apr__allocator.html#ga0">apr_allocator_t</a> *allocator)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga5">apr_pool_create_ex_debug</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> **newpool, <a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *parent, <a class="el" href="group__apr__pools.html#ga1">apr_abortfunc_t</a> abort_fn, <a class="el" href="group__apr__allocator.html#ga0">apr_allocator_t</a> *allocator, const char *file_line)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga6">apr_pool_create</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> **newpool, <a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *parent)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="group__apr__allocator.html#ga0">apr_allocator_t</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga7">apr_pool_allocator_get</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *pool)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga8">apr_pool_clear</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *p)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga9">apr_pool_clear_debug</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *p, const char *file_line)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga10">apr_pool_destroy</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *p)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga11">apr_pool_destroy_debug</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *p, const char *file_line)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void * </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga12">apr_palloc</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *p, apr_size_t size)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void * </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga13">apr_palloc_debug</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *p, apr_size_t size, const char *file_line)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void * </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga14">apr_pcalloc</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *p, apr_size_t size)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void * </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga15">apr_pcalloc_debug</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *p, apr_size_t size, const char *file_line)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga16">apr_pool_abort_set</a> (<a class="el" href="group__apr__pools.html#ga1">apr_abortfunc_t</a> abortfunc, <a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *pool)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="group__apr__pools.html#ga1">apr_abortfunc_t</a> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga17">apr_pool_abort_get</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *pool)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga18">apr_pool_parent_get</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *pool)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga19">apr_pool_is_ancestor</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *a, <a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *b)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga20">apr_pool_tag</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *pool, const char *tag)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga21">apr_pool_userdata_set</a> (const void *data, const char *key, <a class="el" href="group__apr__errno.html#ga0">apr_status_t</a>(*cleanup)(void *), <a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *pool)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga22">apr_pool_userdata_setn</a> (const void *data, const char *key, <a class="el" href="group__apr__errno.html#ga0">apr_status_t</a>(*cleanup)(void *), <a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *pool)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga23">apr_pool_userdata_get</a> (void **data, const char *key, <a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *pool)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga24">apr_pool_cleanup_register</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *p, const void *data, <a class="el" href="group__apr__errno.html#ga0">apr_status_t</a>(*plain_cleanup)(void *), <a class="el" href="group__apr__errno.html#ga0">apr_status_t</a>(*child_cleanup)(void *))</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga25">apr_pool_cleanup_kill</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *p, const void *data, <a class="el" href="group__apr__errno.html#ga0">apr_status_t</a>(*cleanup)(void *))</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga26">apr_pool_child_cleanup_set</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *p, const void *data, <a class="el" href="group__apr__errno.html#ga0">apr_status_t</a>(*plain_cleanup)(void *), <a class="el" href="group__apr__errno.html#ga0">apr_status_t</a>(*child_cleanup)(void *))</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga27">apr_pool_cleanup_run</a> (<a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *p, void *data, <a class="el" href="group__apr__errno.html#ga0">apr_status_t</a>(*cleanup)(void *))</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga28">apr_pool_cleanup_null</a> (void *data)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__pools.html#ga29">apr_pool_cleanup_for_exec</a> (void)</td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="ga33" doxytag="apr_pools.h::APR_POOL__FILE_LINE__" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__) </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
the place in the code where the particular function was called </td>
</tr>
</table>
<a class="anchor" name="ga32" doxytag="apr_pools.h::APR_POOL_DEBUG" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define APR_POOL_DEBUG 0 </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Pool debug levels<p>
<pre>
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
---------------------------------
| | | | | | | | x | General debug code enabled (useful in
combination with --with-efence).</pre><p>
<pre> | | | | | | | x | | Verbose output on stderr (report
CREATE, CLEAR, DESTROY).</pre><p>
<pre> | | | | x | | | | | Verbose output on stderr (report
PALLOC, PCALLOC).</pre><p>
<pre> | | | | | | x | | | Lifetime checking. On each use of a
pool, check its lifetime. If the pool
is out of scope, abort().
In combination with the verbose flag
above, it will output LIFE in such an
event prior to aborting.</pre><p>
<pre> | | | | | x | | | | Pool owner checking. On each use of a
pool, check if the current thread is the
pools owner. If not, abort(). In
combination with the verbose flag above,
it will output OWNER in such an event
prior to aborting. Use the debug
function apr_pool_owner_set() to switch
a pools ownership.</pre><p>
<pre> When no debug level was specified, assume general debug mode.
If level 0 was specified, debugging is switched off
</pre> </td>
</tr>
</table>
<a class="anchor" name="ga30" doxytag="apr_pools.h::APR_POOL_DECLARE_ACCESSOR" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define APR_POOL_DECLARE_ACCESSOR </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">type </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<b>Value:</b><pre class="fragment"><div>APR_DECLARE(apr_pool_t *) apr_##type##_pool_get \
(const apr_##type##_t *the##type)
</div></pre>Declaration helper macro to construct apr_foo_pool_get()s.<p>
This standardized macro is used by opaque (APR) data types to return the apr_pool_t that is associated with the data type.<p>
<a class="el" href="group__apr__pools.html#ga30">APR_POOL_DECLARE_ACCESSOR()</a> is used in a header file to declare the accessor function. A typical usage and result would be: <pre>
<a class="el" href="group__apr__pools.html#ga30">APR_POOL_DECLARE_ACCESSOR(file)</a>;
becomes:
APR_DECLARE(apr_pool_t *) apr_file_pool_get(apr_file_t *ob);
</pre> <dl compact><dt><b>Remarks:</b></dt><dd>Doxygen unwraps this macro (via doxygen.conf) to provide actual help for each specific occurance of apr_foo_pool_get. <p>
the linkage is specified for APR. It would be possible to expand the macros to support other linkages. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga31" doxytag="apr_pools.h::APR_POOL_IMPLEMENT_ACCESSOR" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define APR_POOL_IMPLEMENT_ACCESSOR </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">type </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<b>Value:</b><pre class="fragment"><div>APR_DECLARE(apr_pool_t *) apr_##type##_pool_get \
(const apr_##type##_t *the##type) \
{ <span class="keywordflow">return</span> the##type->pool; }
</div></pre>Implementation helper macro to provide apr_foo_pool_get()s.<p>
In the implementation, the <a class="el" href="group__apr__pools.html#ga31">APR_POOL_IMPLEMENT_ACCESSOR()</a> is used to actually define the function. It assumes the field is named "pool". </td>
</tr>
</table>
<hr><h2>Typedef Documentation</h2>
<a class="anchor" name="ga1" doxytag="apr_pools.h::apr_abortfunc_t" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> typedef int(* <a class="el" href="group__apr__pools.html#ga1">apr_abortfunc_t</a>)(int retcode) </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
A function that is called when allocation fails. </td>
</tr>
</table>
<a class="anchor" name="ga0" doxytag="apr_pools.h::apr_pool_t" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> typedef struct <a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> <a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
The fundamental pool type </td>
</tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga12" doxytag="apr_pools.h::apr_palloc" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void* apr_palloc </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> * </td>
<td class="mdname" nowrap> <em>p</em>, </td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -