1 Star 0 Fork 0

mobangjack / memory

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
classfoonathan_1_1memory_1_1virtual__memory__allocator.html 11.47 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: virtual_memory_allocator Class 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_1virtual__memory__allocator.html">virtual_memory_allocator</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Typedefs</a> &#124;
<a href="#pub-methods">Member Functions</a> </div>
<div class="headertitle">
<div class="title">virtual_memory_allocator Class 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"><p>A stateless <a href="md_doc_concepts.html#concept_rawallocator">RawAllocator</a> that allocates memory using the virtual memory allocation functions. </p>
<p>It does not prereserve any memory and will always reserve and commit combined. </p>
</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:af39606e4a5c19cce39a85e8bcfbbd815"><td class="memItemLeft" align="right" valign="top"><a id="af39606e4a5c19cce39a85e8bcfbbd815"></a>
using&#160;</td><td class="memItemRight" valign="bottom"><b>is_stateful</b> = std::false_type</td></tr>
<tr class="separator:af39606e4a5c19cce39a85e8bcfbbd815"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Member Functions</h2></td></tr>
<tr class="memitem:ae5a20de532d8115f121aa179652b480b"><td class="memItemLeft" align="right" valign="top"><a id="ae5a20de532d8115f121aa179652b480b"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>virtual_memory_allocator</b> (<a class="el" href="classfoonathan_1_1memory_1_1virtual__memory__allocator.html">virtual_memory_allocator</a> &amp;&amp;) noexcept</td></tr>
<tr class="separator:ae5a20de532d8115f121aa179652b480b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeb23214548b1f9f17423b40845aa97b6"><td class="memItemLeft" align="right" valign="top"><a id="aeb23214548b1f9f17423b40845aa97b6"></a>
<a class="el" href="classfoonathan_1_1memory_1_1virtual__memory__allocator.html">virtual_memory_allocator</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (<a class="el" href="classfoonathan_1_1memory_1_1virtual__memory__allocator.html">virtual_memory_allocator</a> &amp;&amp;) noexcept</td></tr>
<tr class="separator:aeb23214548b1f9f17423b40845aa97b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0774f4f3278b78aab48272657c8da07"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1virtual__memory__allocator.html#aa0774f4f3278b78aab48272657c8da07">allocate_node</a> (std::size_t size, std::size_t alignment)</td></tr>
<tr class="separator:aa0774f4f3278b78aab48272657c8da07"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ad08c20db9eb913afdf5fc8de437d58"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1virtual__memory__allocator.html#a3ad08c20db9eb913afdf5fc8de437d58">deallocate_node</a> (void *node, std::size_t size, std::size_t alignment) noexcept</td></tr>
<tr class="separator:a3ad08c20db9eb913afdf5fc8de437d58"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acaa832c9a7c293c443582bce418e6ff7"><td class="memItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1virtual__memory__allocator.html#acaa832c9a7c293c443582bce418e6ff7">max_node_size</a> () const noexcept</td></tr>
<tr class="separator:acaa832c9a7c293c443582bce418e6ff7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad27c2a48d0e62db7ea79ae69f2fa7708"><td class="memItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1virtual__memory__allocator.html#ad27c2a48d0e62db7ea79ae69f2fa7708">max_alignment</a> () const noexcept</td></tr>
<tr class="separator:ad27c2a48d0e62db7ea79ae69f2fa7708"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Functions</h2>
<a id="aa0774f4f3278b78aab48272657c8da07"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa0774f4f3278b78aab48272657c8da07">&#9670;&nbsp;</a></span>allocate_node()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void* allocate_node </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>
</div><div class="memdoc">
<dl class="section user"><dt>Effects:</dt><dd>A <a href="md_doc_concepts.html#concept_rawallocator">RawAllocator</a> allocation function. It uses <a class="el" href="group__allocator.html#gaf5c93e4011951142ba923ce105fd2326">virtual_memory_reserve</a> followed by <a class="el" href="group__allocator.html#ga611ec17550bb9442b14ba7a25d2dcf92">virtual_memory_commit</a> for the allocation. The number of pages allocated will be the minimum to hold <code>size</code> continuous bytes, i.e. <code>size</code> will be rounded up to the next multiple. If debug fences are activated, one additional page before and after the memory will be allocated. </dd></dl>
<dl class="section user"><dt>Returns:</dt><dd>A pointer to a <a href="md_doc_concepts.html#concept_node">node</a>, it will never be <code>nullptr</code>. It will always be aligned on a fence boundary, regardless of the alignment parameter. </dd></dl>
<dl class="section user"><dt>Throws:</dt><dd>An exception of type <a class="el" href="classfoonathan_1_1memory_1_1out__of__memory.html">out_of_memory</a> or whatever is thrown by its handler if the allocation fails. </dd></dl>
</div>
</div>
<a id="a3ad08c20db9eb913afdf5fc8de437d58"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3ad08c20db9eb913afdf5fc8de437d58">&#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">void deallocate_node </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"><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">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Effects:</dt><dd>A <a href="md_doc_concepts.html#concept_rawallocator">RawAllocator</a> deallocation function. It calls <a class="el" href="group__allocator.html#ga10952511b7b0b9e0b536b92044727d45">virtual_memory_decommit</a> followed by <a class="el" href="group__allocator.html#ga7ea785698aa5c576b390e5c61c265c77">virtual_memory_release</a> for the deallocation. </dd></dl>
</div>
</div>
<a id="acaa832c9a7c293c443582bce418e6ff7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acaa832c9a7c293c443582bce418e6ff7">&#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">std::size_t max_node_size </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Returns:</dt><dd>The maximum node size by returning the maximum value. </dd></dl>
</div>
</div>
<a id="ad27c2a48d0e62db7ea79ae69f2fa7708"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad27c2a48d0e62db7ea79ae69f2fa7708">&#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">std::size_t max_alignment </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><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 same as the <a class="el" href="group__allocator.html#gafee5129a1877dc067703d7b24d00035c">virtual_memory_page_size</a>. </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

搜索帮助