1 Star 0 Fork 0

mobangjack / memory

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
classfoonathan_1_1memory_1_1allocator__traits_3_01memory__pool_3_01_pool_type_00_01_impl_raw_allocator_01_4_01_4.html 19.66 KB
一键复制 编辑 原始数据 按行查看 历史
Jonathan Müller 提交于 2020-05-05 17:04 . Update documentation
<!-- HTML header for doxygen 1.8.16-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>memory: allocator_traits&lt; memory_pool&lt; PoolType, ImplRawAllocator &gt; &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">memory
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="main-nav">
<ul class="sm sm-dox" id="main-menu">
<li><a href="index.html">Main Page</a></li>
<li><a href="md_doc_tutorial.html">Tutorial</a></li>
<li><a href="namespacefoonathan_1_1memory.html">Index</a></li>
<li><a href="files.html">Files</a></li>
</ul>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacefoonathan.html">foonathan</a></li><li class="navelem"><a class="el" href="namespacefoonathan_1_1memory.html">memory</a></li><li class="navelem"><a class="el" href="classfoonathan_1_1memory_1_1allocator__traits_3_01memory__pool_3_01_pool_type_00_01_impl_raw_allocator_01_4_01_4.html">allocator_traits&lt; memory_pool&lt; PoolType, ImplRawAllocator &gt; &gt;</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Typedefs</a> &#124;
<a href="#pub-static-methods">Static Functions</a> </div>
<div class="headertitle">
<div class="title">allocator_traits&lt; memory_pool&lt; PoolType, ImplRawAllocator &gt; &gt; Class Template Reference<div class="ingroups"><a class="el" href="group__allocator.html">Allocator implementations</a></div></div> </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename PoolType, class ImplRawAllocator&gt;<br />
class foonathan::memory::allocator_traits&lt; memory_pool&lt; PoolType, ImplRawAllocator &gt; &gt;</h3>
<p>Specialization of the <a class="el" href="classfoonathan_1_1memory_1_1allocator__traits.html">allocator_traits</a> for <a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html">memory_pool</a> classes. </p>
<dl class="section note"><dt>Note</dt><dd>It is not allowed to mix calls through the specialization and through the member functions, i.e. <a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html#aea24233cc1a3d57ad06a749cc548abdb">memory_pool::allocate_node()</a> and this <code>allocate_node()</code>. </dd></dl>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Typedefs</h2></td></tr>
<tr class="memitem:adaca1cc8d714d7d82f054e7a554962cf"><td class="memItemLeft" align="right" valign="top"><a id="adaca1cc8d714d7d82f054e7a554962cf"></a>
using&#160;</td><td class="memItemRight" valign="bottom"><b>allocator_type</b> = <a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html">memory_pool</a>&lt; PoolType, ImplRawAllocator &gt;</td></tr>
<tr class="separator:adaca1cc8d714d7d82f054e7a554962cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa60441e067587b7756b1c1727c928d3d"><td class="memItemLeft" align="right" valign="top"><a id="aa60441e067587b7756b1c1727c928d3d"></a>
using&#160;</td><td class="memItemRight" valign="bottom"><b>is_stateful</b> = std::true_type</td></tr>
<tr class="separator:aa60441e067587b7756b1c1727c928d3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Functions</h2></td></tr>
<tr class="memitem:aa694dba152e5ebd82e6bbae930e7a328"><td class="memItemLeft" align="right" valign="top">static void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1allocator__traits_3_01memory__pool_3_01_pool_type_00_01_impl_raw_allocator_01_4_01_4.html#aa694dba152e5ebd82e6bbae930e7a328">allocate_node</a> (<a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html">allocator_type</a> &amp;state, std::size_t size, std::size_t alignment)</td></tr>
<tr class="separator:aa694dba152e5ebd82e6bbae930e7a328"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59fd7d743c9b6f07b57b12299d9bf2d5"><td class="memItemLeft" align="right" valign="top">static void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1allocator__traits_3_01memory__pool_3_01_pool_type_00_01_impl_raw_allocator_01_4_01_4.html#a59fd7d743c9b6f07b57b12299d9bf2d5">allocate_array</a> (<a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html">allocator_type</a> &amp;state, std::size_t count, std::size_t size, std::size_t alignment)</td></tr>
<tr class="separator:a59fd7d743c9b6f07b57b12299d9bf2d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6188c26a298163e40251d41edb0415b1"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1allocator__traits_3_01memory__pool_3_01_pool_type_00_01_impl_raw_allocator_01_4_01_4.html#a6188c26a298163e40251d41edb0415b1">deallocate_node</a> (<a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html">allocator_type</a> &amp;state, void *node, std::size_t size, std::size_t) noexcept</td></tr>
<tr class="separator:a6188c26a298163e40251d41edb0415b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab654c34fe7e070a8989eda67d0bccca0"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1allocator__traits_3_01memory__pool_3_01_pool_type_00_01_impl_raw_allocator_01_4_01_4.html#ab654c34fe7e070a8989eda67d0bccca0">deallocate_array</a> (<a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html">allocator_type</a> &amp;state, void *array, std::size_t count, std::size_t size, std::size_t) noexcept</td></tr>
<tr class="separator:ab654c34fe7e070a8989eda67d0bccca0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a224292c5e45b0ce1ad3203cd02063f0b"><td class="memItemLeft" align="right" valign="top">static std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1allocator__traits_3_01memory__pool_3_01_pool_type_00_01_impl_raw_allocator_01_4_01_4.html#a224292c5e45b0ce1ad3203cd02063f0b">max_node_size</a> (const <a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html">allocator_type</a> &amp;state) noexcept</td></tr>
<tr class="separator:a224292c5e45b0ce1ad3203cd02063f0b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade4e801f8b51c9c5b9644dcf1942ea72"><td class="memItemLeft" align="right" valign="top">static std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1allocator__traits_3_01memory__pool_3_01_pool_type_00_01_impl_raw_allocator_01_4_01_4.html#ade4e801f8b51c9c5b9644dcf1942ea72">max_array_size</a> (const <a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html">allocator_type</a> &amp;state) noexcept</td></tr>
<tr class="separator:ade4e801f8b51c9c5b9644dcf1942ea72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a69bf08a77809e087b5858c92e9900cb2"><td class="memItemLeft" align="right" valign="top">static std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1allocator__traits_3_01memory__pool_3_01_pool_type_00_01_impl_raw_allocator_01_4_01_4.html#a69bf08a77809e087b5858c92e9900cb2">max_alignment</a> (const <a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html">allocator_type</a> &amp;state) noexcept</td></tr>
<tr class="separator:a69bf08a77809e087b5858c92e9900cb2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Functions</h2>
<a id="aa694dba152e5ebd82e6bbae930e7a328"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa694dba152e5ebd82e6bbae930e7a328">&#9670;&nbsp;</a></span>allocate_node()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void* allocate_node </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html">allocator_type</a> &amp;&#160;</td>
<td class="paramname"><em>state</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::size_t&#160;</td>
<td class="paramname"><em>size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::size_t&#160;</td>
<td class="paramname"><em>alignment</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Returns:</dt><dd>The result of <a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html#aea24233cc1a3d57ad06a749cc548abdb">memory_pool::allocate_node()</a>. </dd></dl>
<dl class="section user"><dt>Throws:</dt><dd>Anything thrown by the pool allocation function or a <a class="el" href="classfoonathan_1_1memory_1_1bad__allocation__size.html">bad_allocation_size</a> exception. </dd></dl>
</div>
</div>
<a id="a59fd7d743c9b6f07b57b12299d9bf2d5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a59fd7d743c9b6f07b57b12299d9bf2d5">&#9670;&nbsp;</a></span>allocate_array()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void* allocate_array </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html">allocator_type</a> &amp;&#160;</td>
<td class="paramname"><em>state</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::size_t&#160;</td>
<td class="paramname"><em>count</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::size_t&#160;</td>
<td class="paramname"><em>size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::size_t&#160;</td>
<td class="paramname"><em>alignment</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Effects:</dt><dd>Forwards to <a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html#a634628f2fb08da33a23f1611e7103527">memory_pool::allocate_array()</a> with the number of nodes adjusted to be the minimum, i.e. when the <code>size</code> is less than the <a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html#a5d4e471c06eda1a92506955593a4fd7b">memory_pool::node_size()</a>. </dd></dl>
<dl class="section user"><dt>Returns:</dt><dd>A <a href="md_doc_concepts.html#concept_array">array</a> with specified properties. </dd></dl>
<dl class="section user"><dt>Requires:</dt><dd>The <a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html">memory_pool</a> has to support array allocations. </dd></dl>
<dl class="section user"><dt>Throws:</dt><dd>Anything thrown by the pool allocation function. </dd></dl>
</div>
</div>
<a id="a6188c26a298163e40251d41edb0415b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6188c26a298163e40251d41edb0415b1">&#9670;&nbsp;</a></span>deallocate_node()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void deallocate_node </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html">allocator_type</a> &amp;&#160;</td>
<td class="paramname"><em>state</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>node</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::size_t&#160;</td>
<td class="paramname"><em>size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::size_t&#160;</td>
<td class="paramname">&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Effects:</dt><dd>Just forwards to <a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html#a53347e3af0df64804fa25ab1482fa0bd">memory_pool::deallocate_node()</a>. </dd></dl>
</div>
</div>
<a id="ab654c34fe7e070a8989eda67d0bccca0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab654c34fe7e070a8989eda67d0bccca0">&#9670;&nbsp;</a></span>deallocate_array()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void deallocate_array </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html">allocator_type</a> &amp;&#160;</td>
<td class="paramname"><em>state</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>array</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::size_t&#160;</td>
<td class="paramname"><em>count</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::size_t&#160;</td>
<td class="paramname"><em>size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::size_t&#160;</td>
<td class="paramname">&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Effects:</dt><dd>Forwards to <a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html#a23ee5abed4a79390885e45c7dcb1a663">memory_pool::deallocate_array()</a> with the same size adjustment. </dd></dl>
</div>
</div>
<a id="a224292c5e45b0ce1ad3203cd02063f0b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a224292c5e45b0ce1ad3203cd02063f0b">&#9670;&nbsp;</a></span>max_node_size()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static std::size_t max_node_size </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html">allocator_type</a> &amp;&#160;</td>
<td class="paramname"><em>state</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Returns:</dt><dd>The maximum size of each node which is <a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html#a5d4e471c06eda1a92506955593a4fd7b">memory_pool::node_size()</a>. </dd></dl>
</div>
</div>
<a id="ade4e801f8b51c9c5b9644dcf1942ea72"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ade4e801f8b51c9c5b9644dcf1942ea72">&#9670;&nbsp;</a></span>max_array_size()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static std::size_t max_array_size </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html">allocator_type</a> &amp;&#160;</td>
<td class="paramname"><em>state</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Returns:</dt><dd>An upper bound on the maximum array size which is <a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html#af4fe037332aabd13253517d22394da73">memory_pool::next_capacity()</a>. </dd></dl>
</div>
</div>
<a id="a69bf08a77809e087b5858c92e9900cb2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a69bf08a77809e087b5858c92e9900cb2">&#9670;&nbsp;</a></span>max_alignment()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static std::size_t max_alignment </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classfoonathan_1_1memory_1_1memory__pool.html">allocator_type</a> &amp;&#160;</td>
<td class="paramname"><em>state</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Returns:</dt><dd>The maximum alignment which is the next bigger power of two if less than <code>alignof(std::max_align_t)</code> or the maximum alignment itself otherwise. </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.16-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
</html>
1
https://gitee.com/mobangjack/memory.git
git@gitee.com:mobangjack/memory.git
mobangjack
memory
memory
gh-pages

搜索帮助