📄 group__apr__allocator.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: Internal Memory Allocation</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>Internal Memory Allocation</h1><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>struct </td><td class="memItemRight" valign=bottom><a class="el" href="structapr__memnode__t.html">apr_memnode_t</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__allocator.html#ga11">APR_MEMNODE_T_SIZE</a> APR_ALIGN_DEFAULT(sizeof(<a class="el" href="structapr__memnode__t.html">apr_memnode_t</a>))</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__allocator.html#ga12">APR_ALLOCATOR_MAX_FREE_UNLIMITED</a> 0</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__allocator.html#ga0">apr_allocator_t</a> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__allocator.html#ga0">apr_allocator_t</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef <a class="el" href="structapr__memnode__t.html">apr_memnode_t</a> </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__allocator.html#ga1">apr_memnode_t</a></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__allocator.html#ga2">apr_allocator_create</a> (<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>void </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__allocator.html#ga3">apr_allocator_destroy</a> (<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="structapr__memnode__t.html">apr_memnode_t</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__allocator.html#ga4">apr_allocator_alloc</a> (<a class="el" href="group__apr__allocator.html#ga0">apr_allocator_t</a> *allocator, 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__allocator.html#ga5">apr_allocator_free</a> (<a class="el" href="group__apr__allocator.html#ga0">apr_allocator_t</a> *allocator, <a class="el" href="structapr__memnode__t.html">apr_memnode_t</a> *memnode)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__allocator.html#ga6">apr_allocator_owner_set</a> (<a class="el" href="group__apr__allocator.html#ga0">apr_allocator_t</a> *allocator, <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__allocator.html#ga7">apr_allocator_owner_get</a> (<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>void </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__allocator.html#ga8">apr_allocator_max_free_set</a> (<a class="el" href="group__apr__allocator.html#ga0">apr_allocator_t</a> *allocator, 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__allocator.html#ga9">apr_allocator_mutex_set</a> (<a class="el" href="group__apr__allocator.html#ga0">apr_allocator_t</a> *allocator, <a class="el" href="group__apr__thread__mutex.html#ga0">apr_thread_mutex_t</a> *mutex)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="group__apr__thread__mutex.html#ga0">apr_thread_mutex_t</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="group__apr__allocator.html#ga10">apr_allocator_mutex_get</a> (<a class="el" href="group__apr__allocator.html#ga0">apr_allocator_t</a> *allocator)</td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="ga12" doxytag="apr_allocator.h::APR_ALLOCATOR_MAX_FREE_UNLIMITED" ></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_ALLOCATOR_MAX_FREE_UNLIMITED 0 </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Symbolic constants </td>
</tr>
</table>
<a class="anchor" name="ga11" doxytag="apr_allocator.h::APR_MEMNODE_T_SIZE" ></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_MEMNODE_T_SIZE APR_ALIGN_DEFAULT(sizeof(<a class="el" href="structapr__memnode__t.html">apr_memnode_t</a>)) </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
The base size of a memory node - aligned. </td>
</tr>
</table>
<hr><h2>Typedef Documentation</h2>
<a class="anchor" name="ga0" doxytag="apr_allocator.h::apr_allocator_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__allocator.html#ga0">apr_allocator_t</a> <a class="el" href="group__apr__allocator.html#ga0">apr_allocator_t</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
the allocator structure </td>
</tr>
</table>
<a class="anchor" name="ga1" doxytag="apr_allocator.h::apr_memnode_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="structapr__memnode__t.html">apr_memnode_t</a> <a class="el" href="structapr__memnode__t.html">apr_memnode_t</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
the structure which holds information about the allocation </td>
</tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga4" doxytag="apr_allocator.h::apr_allocator_alloc" ></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"> <a class="el" href="structapr__memnode__t.html">apr_memnode_t</a>* apr_allocator_alloc </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="group__apr__allocator.html#ga0">apr_allocator_t</a> * </td>
<td class="mdname" nowrap> <em>allocator</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>apr_size_t </td>
<td class="mdname" nowrap> <em>size</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Allocate a block of mem from the allocator <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>allocator</em> </td><td>The allocator to allocate from </td></tr>
<tr><td></td><td valign=top><em>size</em> </td><td>The size of the mem to allocate (excluding the memnode structure) </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a class="anchor" name="ga2" doxytag="apr_allocator.h::apr_allocator_create" ></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"> <a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> apr_allocator_create </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="group__apr__allocator.html#ga0">apr_allocator_t</a> ** </td>
<td class="mdname1" valign="top" nowrap> <em>allocator</em> </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>
Create a new allocator <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>allocator</em> </td><td>The allocator we have just created. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a class="anchor" name="ga3" doxytag="apr_allocator.h::apr_allocator_destroy" ></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_allocator_destroy </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="group__apr__allocator.html#ga0">apr_allocator_t</a> * </td>
<td class="mdname1" valign="top" nowrap> <em>allocator</em> </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>
Destroy an allocator <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>allocator</em> </td><td>The allocator to be destroyed </td></tr>
</table>
</dl>
<dl compact><dt><b>Remarks:</b></dt><dd>Any memnodes not given back to the allocator prior to destroying will _not_ be free()d. </dd></dl>
</td>
</tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -