1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-07 04:10:27 -08:00
emacs/mps/manual/html/pool/amcz.html
Gareth Rees 90b84881d8 Bring mps manual html up to date.
Copied from Perforce
 Change: 180908
 ServerID: perforce.ravenbrook.com
2013-02-05 13:37:39 +00:00

159 lines
No EOL
9.6 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://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/html; charset=utf-8" />
<title>5. AMCZ (Automatic Mostly-Copying Zero-rank) &mdash; Memory Pool System 1.111.0 documentation</title>
<link rel="stylesheet" href="../_static/mps.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '1.111.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="copyright" title="Copyright" href="../copyright.html" />
<link rel="top" title="Memory Pool System 1.111.0 documentation" href="../index.html" />
<link rel="up" title="Pool reference" href="index.html" />
<link rel="next" title="6. AMS (Automatic Mark and Sweep)" href="ams.html" />
<link rel="prev" title="4. AMC (Automatic Mostly-Copying)" href="amc.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="ams.html" title="6. AMS (Automatic Mark and Sweep)"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="amc.html" title="4. AMC (Automatic Mostly-Copying)"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">Memory Pool System 1.111.0 documentation</a> &raquo;</li>
<li><a href="index.html" accesskey="U">Pool reference</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="amcz-automatic-mostly-copying-zero-rank">
<span id="pool-amcz"></span><span id="index-0"></span><h1>5. AMCZ (Automatic Mostly-Copying Zero-rank)<a class="headerlink" href="#amcz-automatic-mostly-copying-zero-rank" title="Permalink to this headline"></a></h1>
<p><strong>AMCZ</strong> is a general-purpose <a class="reference internal" href="../glossary/a.html#term-automatic-memory-management"><em class="xref std std-term">automatically managed</em></a> <a class="reference internal" href="../glossary/p.html#term-pool-class"><em class="xref std std-term">pool class</em></a> for <a class="reference internal" href="../glossary/l.html#term-leaf-object"><em class="xref std std-term">leaf objects</em></a>
(&#8220;zero-rank&#8221; objects that contain no references).</p>
<p>It is otherwise indentical to <a class="reference internal" href="amc.html#pool-amc"><em>AMC (Automatic Mostly-Copying)</em></a>.</p>
<p>AMCZ is intended for &#8220;simple&#8221; objects like numbers, characters, and
strings. Segregating these objects into one or more AMCZ pools avoids
the cost of scanning them that would be incurred if they were
interleaved in a pool with objects containing references. It may also
simplify the scanning of the objects that are left behind.</p>
<p>See <a class="reference internal" href="../guide/advanced.html#guide-advanced-segregation"><em>Segregation of objects</em></a> for an example.</p>
<div class="section" id="amcz-properties">
<span id="index-1"></span><h2>5.1. AMCZ properties<a class="headerlink" href="#amcz-properties" title="Permalink to this headline"></a></h2>
<p>AMCZ is indentical to <a class="reference internal" href="amc.html#pool-amc"><em>AMC (Automatic Mostly-Copying)</em></a>, except that:</p>
<ul class="simple">
<li>Blocks may not contain <a class="reference internal" href="../glossary/r.html#term-reference"><em class="xref std std-term">references</em></a> to blocks in automatically
managed pools.</li>
<li>Blocks are not <a class="reference internal" href="../glossary/s.html#term-scan"><em class="xref std std-term">scanned</em></a>. A consequence of this is that
the pool&#8217;s <a class="reference internal" href="../glossary/o.html#term-object-format"><em class="xref std std-term">object format</em></a> need not provide a <a class="reference internal" href="../glossary/s.html#term-scan-method"><em class="xref std std-term">scan
method</em></a>.</li>
<li>Blocks are not protected by <a class="reference internal" href="../glossary/b.html#term-barrier-1"><em class="xref std std-term">barriers<sup>(1)</sup></em></a>.</li>
</ul>
</div>
<div class="section" id="amcz-interface">
<span id="index-2"></span><h2>5.2. AMCZ interface<a class="headerlink" href="#amcz-interface" title="Permalink to this headline"></a></h2>
<div class="highlight-c"><div class="highlight"><pre><span class="cp">#include &quot;mpscamc.h&quot;</span>
</pre></div>
</div>
<dl class="function">
<dt id="mps_class_amcz">
<a class="reference internal" href="../topic/pool.html#mps_class_t" title="mps_class_t">mps_class_t</a> <tt class="descname">mps_class_amcz</tt><big>(</big>void<big>)</big><a class="headerlink" href="#mps_class_amcz" title="Permalink to this definition"></a></dt>
<dd><p>Return the <a class="reference internal" href="../glossary/p.html#term-pool-class"><em class="xref std std-term">pool class</em></a> for an AMCZ (Automatic
Mostly-Copying Zero-rank) <a class="reference internal" href="../glossary/p.html#term-pool"><em class="xref std std-term">pool</em></a>.</p>
<p>When creating an AMCZ pool, <a class="reference internal" href="../topic/pool.html#mps_pool_create" title="mps_pool_create"><tt class="xref c c-func docutils literal"><span class="pre">mps_pool_create()</span></tt></a> takes two
extra arguments:</p>
<div class="highlight-c"><div class="highlight"><pre><span class="n">mps_res_t</span> <span class="n">mps_pool_create</span><span class="p">(</span><span class="n">mps_pool_t</span> <span class="o">*</span><span class="n">pool_o</span><span class="p">,</span> <span class="n">mps_arena_t</span> <span class="n">arena</span><span class="p">,</span>
<span class="n">mps_class_t</span> <span class="n">mps_class_amcz</span><span class="p">(),</span>
<span class="n">mps_fmt_t</span> <span class="n">fmt</span><span class="p">,</span>
<span class="n">mps_chain_t</span> <span class="n">chain</span><span class="p">)</span>
</pre></div>
</div>
<p><tt class="docutils literal"><span class="pre">fmt</span></tt> specifies the <a class="reference internal" href="../glossary/o.html#term-object-format"><em class="xref std std-term">object format</em></a> for the objects
allocated in the pool. The format must provide a <a class="reference internal" href="../glossary/s.html#term-skip-method"><em class="xref std std-term">skip
method</em></a>, a <a class="reference internal" href="../glossary/f.html#term-forward-method"><em class="xref std std-term">forward method</em></a>, an <a class="reference internal" href="../glossary/i.html#term-is-forwarded-method"><em class="xref std std-term">is-forwarded method</em></a>
and a <a class="reference internal" href="../glossary/p.html#term-padding-method"><em class="xref std std-term">padding method</em></a>.</p>
<p><tt class="docutils literal"><span class="pre">chain</span></tt> specifies the <a class="reference internal" href="../glossary/g.html#term-generation-chain"><em class="xref std std-term">generation chain</em></a> for the pool.</p>
</dd></dl>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/logo.png" alt="Logo"/>
</a></p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">5. AMCZ (Automatic Mostly-Copying Zero-rank)</a><ul>
<li><a class="reference internal" href="#amcz-properties">5.1. AMCZ properties</a></li>
<li><a class="reference internal" href="#amcz-interface">5.2. AMCZ interface</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="amc.html"
title="previous chapter">4. AMC (Automatic Mostly-Copying)</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="ams.html"
title="next chapter">6. AMS (Automatic Mark and Sweep)</a></p><h4>Contact us</h4>
<p class="topless"><a href="mailto:mps-questions@ravenbrook.com">mps-questions@ravenbrook.com</a></p>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="ams.html" title="6. AMS (Automatic Mark and Sweep)"
>next</a> |</li>
<li class="right" >
<a href="amc.html" title="4. AMC (Automatic Mostly-Copying)"
>previous</a> |</li>
<li><a href="../index.html">Memory Pool System 1.111.0 documentation</a> &raquo;</li>
<li><a href="index.html" >Pool reference</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; <a href="../copyright.html">Copyright</a> 2012, Ravenbrook Limited.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
</div>
</body>
</html>