mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-01 09:51:22 -08:00
685 lines
No EOL
28 KiB
HTML
685 lines
No EOL
28 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>1. Choosing a pool class — 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="4. AMC (Automatic Mostly-Copying)" href="amc.html" />
|
|
<link rel="prev" title="Pool reference" href="index.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="amc.html" title="4. AMC (Automatic Mostly-Copying)"
|
|
accesskey="N">next</a> |</li>
|
|
<li class="right" >
|
|
<a href="index.html" title="Pool reference"
|
|
accesskey="P">previous</a> |</li>
|
|
<li><a href="../index.html">Memory Pool System 1.111.0 documentation</a> »</li>
|
|
<li><a href="index.html" accesskey="U">Pool reference</a> »</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="document">
|
|
<div class="documentwrapper">
|
|
<div class="bodywrapper">
|
|
<div class="body">
|
|
|
|
<div class="section" id="choosing-a-pool-class">
|
|
<span id="pool-choose"></span><span id="index-0"></span><h1>1. Choosing a pool class<a class="headerlink" href="#choosing-a-pool-class" title="Permalink to this headline">¶</a></h1>
|
|
<p>This section contains a simple procedure for choosing a <a class="reference internal" href="../glossary/p.html#term-pool-class"><em class="xref std std-term">pool
|
|
class</em></a> based on the properties of the data you plan to store in
|
|
it. The MPS works well if you can segregate your data into a variety
|
|
of pools, choosing the most appropriate pool class for each.</p>
|
|
<div class="admonition-note admonition">
|
|
<p class="first admonition-title">Note</p>
|
|
<p class="last">Pool classes can differ in many ways not considered here: speed,
|
|
vulnerability to fragmentation, control overhead, and so on. This
|
|
procedure gives you a decent recommendation, but an expert in the
|
|
MPS might be able to make a better recommendation. And if no pool
|
|
class in the open source MPS exactly matches your needs, then it
|
|
is possible to develop new pool classes. See <a class="reference internal" href="#pool-writing"><em>Writing a new pool class</em></a>.</p>
|
|
</div>
|
|
<p>First, answer these questions about your data:</p>
|
|
<ol class="arabic simple">
|
|
<li>Do you need the MPS to <a class="reference internal" href="../glossary/a.html#term-automatic-memory-management"><em class="xref std std-term">automatically</em></a> <a class="reference internal" href="../glossary/r.html#term-reclaim"><em class="xref std std-term">reclaim</em></a> <a class="reference internal" href="../glossary/u.html#term-unreachable"><em class="xref std std-term">unreachable</em></a> blocks?</li>
|
|
<li>Is it acceptable for the MPS to <a class="reference internal" href="../glossary/m.html#term-moving-memory-manager"><em class="xref std std-term">move</em></a> blocks in memory and to place <a class="reference internal" href="../glossary/b.html#term-barrier-1"><em class="xref std std-term">barriers<sup>(1)</sup></em></a> on
|
|
blocks? (For example, it might not be acceptable to move a block if
|
|
it has been passed to <a class="reference internal" href="../glossary/f.html#term-foreign-code"><em class="xref std std-term">foreign code</em></a> that remembered its
|
|
location.)</li>
|
|
<li>Do your blocks contain <a class="reference internal" href="../glossary/r.html#term-reference"><em class="xref std std-term">references</em></a> to blocks stored in
|
|
automatically managed pools (including references to other blocks
|
|
in the same pool, if it’s automatically managed)? And if so, are
|
|
these references <a class="reference internal" href="../glossary/e.html#term-exact-reference"><em class="xref std std-term">exact</em></a>, <a class="reference internal" href="../glossary/a.html#term-ambiguous-reference"><em class="xref std std-term">ambiguous</em></a> or <a class="reference internal" href="../glossary/w.html#term-weak-reference-1"><em class="xref std std-term">weak</em></a>?</li>
|
|
</ol>
|
|
<p>Second, look up your answers in this table to find the recommended
|
|
pool class to use:</p>
|
|
<table border="1" class="docutils">
|
|
<colgroup>
|
|
<col width="13%" />
|
|
<col width="28%" />
|
|
<col width="14%" />
|
|
<col width="46%" />
|
|
</colgroup>
|
|
<thead valign="bottom">
|
|
<tr class="row-odd"><th class="head">Automatic?</th>
|
|
<th class="head">Movable & protectable?</th>
|
|
<th class="head">References?</th>
|
|
<th class="head">Use this pool class</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody valign="top">
|
|
<tr class="row-even"><td>yes</td>
|
|
<td>yes</td>
|
|
<td>none</td>
|
|
<td><a class="reference internal" href="amcz.html#pool-amcz"><em>AMCZ (Automatic Mostly-Copying Zero-rank)</em></a></td>
|
|
</tr>
|
|
<tr class="row-odd"><td>yes</td>
|
|
<td>yes</td>
|
|
<td>exact</td>
|
|
<td><a class="reference internal" href="amc.html#pool-amc"><em>AMC (Automatic Mostly-Copying)</em></a></td>
|
|
</tr>
|
|
<tr class="row-even"><td>yes</td>
|
|
<td>yes</td>
|
|
<td>ambiguous</td>
|
|
<td>nothing suitable</td>
|
|
</tr>
|
|
<tr class="row-odd"><td>yes</td>
|
|
<td>yes</td>
|
|
<td>weak</td>
|
|
<td><a class="reference internal" href="awl.html#pool-awl"><em>AWL (Automatic Weak Linked)</em></a></td>
|
|
</tr>
|
|
<tr class="row-even"><td>yes</td>
|
|
<td>no</td>
|
|
<td>none</td>
|
|
<td><a class="reference internal" href="lo.html#pool-lo"><em>LO (Leaf Object)</em></a></td>
|
|
</tr>
|
|
<tr class="row-odd"><td>yes</td>
|
|
<td>no</td>
|
|
<td>exact</td>
|
|
<td><a class="reference internal" href="ams.html#pool-ams"><em>AMS (Automatic Mark and Sweep)</em></a></td>
|
|
</tr>
|
|
<tr class="row-even"><td>yes</td>
|
|
<td>no</td>
|
|
<td>ambiguous</td>
|
|
<td>nothing suitable</td>
|
|
</tr>
|
|
<tr class="row-odd"><td>yes</td>
|
|
<td>no</td>
|
|
<td>weak</td>
|
|
<td>nothing suitable</td>
|
|
</tr>
|
|
<tr class="row-even"><td>no</td>
|
|
<td><em>any</em></td>
|
|
<td>none</td>
|
|
<td><a class="reference internal" href="mvff.html#pool-mvff"><em>MVFF (Manual Variable First Fit)</em></a></td>
|
|
</tr>
|
|
<tr class="row-odd"><td>no</td>
|
|
<td><em>any</em></td>
|
|
<td>exact</td>
|
|
<td><a class="reference internal" href="mvff.html#pool-mvff"><em>MVFF (Manual Variable First Fit)</em></a> <a class="footnote-reference" href="#id4" id="id1">[1]</a></td>
|
|
</tr>
|
|
<tr class="row-even"><td>no</td>
|
|
<td><em>any</em></td>
|
|
<td>ambiguous</td>
|
|
<td><a class="reference internal" href="mvff.html#pool-mvff"><em>MVFF (Manual Variable First Fit)</em></a> <a class="footnote-reference" href="#id4" id="id2">[1]</a></td>
|
|
</tr>
|
|
<tr class="row-odd"><td>no</td>
|
|
<td><em>any</em></td>
|
|
<td>weak</td>
|
|
<td><a class="reference internal" href="mvff.html#pool-mvff"><em>MVFF (Manual Variable First Fit)</em></a> <a class="footnote-reference" href="#id4" id="id3">[1]</a></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div class="admonition-note admonition">
|
|
<p class="first admonition-title">Note</p>
|
|
<table class="last docutils footnote" frame="void" id="id4" rules="none">
|
|
<colgroup><col class="label" /><col /></colgroup>
|
|
<tbody valign="top">
|
|
<tr><td class="label">[1]</td><td><em>(<a class="fn-backref" href="#id1">1</a>, <a class="fn-backref" href="#id2">2</a>, <a class="fn-backref" href="#id3">3</a>)</em> <a class="reference internal" href="mvff.html#pool-mvff"><em>MVFF (Manual Variable First Fit)</em></a> doesn’t scan for references, but you can
|
|
work around this by registering your blocks as
|
|
<a class="reference internal" href="../glossary/r.html#term-root"><em class="xref std std-term">roots</em></a> (with the appropriate <a class="reference internal" href="../glossary/r.html#term-rank"><em class="xref std std-term">rank</em></a>) just
|
|
after they are allocated, and deregistering them just
|
|
before freeing them.</td></tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="pool-class-properties">
|
|
<span id="pool-properties"></span><span id="index-1"></span><h1>2. Pool class properties<a class="headerlink" href="#pool-class-properties" title="Permalink to this headline">¶</a></h1>
|
|
<p>This table summarizes the properties of each <a class="reference internal" href="../glossary/p.html#term-pool-class"><em class="xref std std-term">pool class</em></a>
|
|
provided by the open source MPS. For “block” properties, “yes” means
|
|
that the property holds for <em>all</em> blocks allocated from the pool. An
|
|
entry “—” indicates that a property makes no sense for a pool class:
|
|
for example, if blocks in a pool may not contain <a class="reference internal" href="../glossary/r.html#term-reference"><em class="xref std std-term">references</em></a>,
|
|
it makes no sense to ask whether they may contain <a class="reference internal" href="../glossary/w.html#term-weak-reference-1"><em class="xref std std-term">weak
|
|
references<sup>(1)</sup></em></a>.</p>
|
|
<table border="1" class="docutils">
|
|
<colgroup>
|
|
<col width="47%" />
|
|
<col width="5%" />
|
|
<col width="5%" />
|
|
<col width="5%" />
|
|
<col width="5%" />
|
|
<col width="5%" />
|
|
<col width="5%" />
|
|
<col width="5%" />
|
|
<col width="5%" />
|
|
<col width="5%" />
|
|
<col width="5%" />
|
|
</colgroup>
|
|
<thead valign="bottom">
|
|
<tr class="row-odd"><th class="head">Property</th>
|
|
<th class="head">AMC</th>
|
|
<th class="head">AMCZ</th>
|
|
<th class="head">AMS</th>
|
|
<th class="head">AWL</th>
|
|
<th class="head">LO</th>
|
|
<th class="head">MFS</th>
|
|
<th class="head">MV</th>
|
|
<th class="head">MVFF</th>
|
|
<th class="head">MVT</th>
|
|
<th class="head">SNC</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody valign="top">
|
|
<tr class="row-even"><td>Supports <a class="reference internal" href="../topic/allocation.html#mps_alloc" title="mps_alloc"><tt class="xref c c-func docutils literal"><span class="pre">mps_alloc()</span></tt></a>?</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
</tr>
|
|
<tr class="row-odd"><td>Supports <a class="reference internal" href="../topic/allocation.html#mps_free" title="mps_free"><tt class="xref c c-func docutils literal"><span class="pre">mps_free()</span></tt></a>?</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>no</td>
|
|
</tr>
|
|
<tr class="row-even"><td>Supports allocation points?</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
</tr>
|
|
<tr class="row-odd"><td>Supports allocation frames?</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
</tr>
|
|
<tr class="row-even"><td>Supports segregated allocation caches?</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
</tr>
|
|
<tr class="row-odd"><td>Timing of collections? <a class="footnote-reference" href="#id23" id="id5">[2]</a></td>
|
|
<td>auto</td>
|
|
<td>auto</td>
|
|
<td>auto</td>
|
|
<td>auto</td>
|
|
<td>auto</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
</tr>
|
|
<tr class="row-even"><td>May contain references? <a class="footnote-reference" href="#id24" id="id6">[3]</a></td>
|
|
<td>yes</td>
|
|
<td>no</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>yes</td>
|
|
</tr>
|
|
<tr class="row-odd"><td>May contain exact references? <a class="footnote-reference" href="#id25" id="id7">[4]</a></td>
|
|
<td>yes</td>
|
|
<td>—</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>yes</td>
|
|
</tr>
|
|
<tr class="row-even"><td>May contain ambiguous references? <a class="footnote-reference" href="#id25" id="id8">[4]</a></td>
|
|
<td>no</td>
|
|
<td>—</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>no</td>
|
|
</tr>
|
|
<tr class="row-odd"><td>May contain weak references? <a class="footnote-reference" href="#id25" id="id9">[4]</a></td>
|
|
<td>no</td>
|
|
<td>—</td>
|
|
<td>no</td>
|
|
<td>yes</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>no</td>
|
|
</tr>
|
|
<tr class="row-even"><td>Allocations fixed or variable in size?</td>
|
|
<td>var</td>
|
|
<td>var</td>
|
|
<td>var</td>
|
|
<td>var</td>
|
|
<td>var</td>
|
|
<td>fixed</td>
|
|
<td>var</td>
|
|
<td>var</td>
|
|
<td>var</td>
|
|
<td>var</td>
|
|
</tr>
|
|
<tr class="row-odd"><td>Alignment? <a class="footnote-reference" href="#id26" id="id10">[5]</a></td>
|
|
<td>conf</td>
|
|
<td>conf</td>
|
|
<td>conf</td>
|
|
<td>conf</td>
|
|
<td>conf</td>
|
|
<td><a class="footnote-reference" href="#id27" id="id11">[6]</a></td>
|
|
<td><a class="footnote-reference" href="#id27" id="id12">[6]</a></td>
|
|
<td><a class="footnote-reference" href="#id28" id="id13">[7]</a></td>
|
|
<td><a class="footnote-reference" href="#id27" id="id14">[6]</a></td>
|
|
<td>conf</td>
|
|
</tr>
|
|
<tr class="row-even"><td>Dependent objects? <a class="footnote-reference" href="#id29" id="id15">[8]</a></td>
|
|
<td>no</td>
|
|
<td>—</td>
|
|
<td>no</td>
|
|
<td>yes</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>no</td>
|
|
</tr>
|
|
<tr class="row-odd"><td>May use remote references? <a class="footnote-reference" href="#id30" id="id16">[9]</a></td>
|
|
<td>no</td>
|
|
<td>—</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>no</td>
|
|
</tr>
|
|
<tr class="row-even"><td>Blocks are automatically managed? <a class="footnote-reference" href="#id31" id="id17">[10]</a></td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
</tr>
|
|
<tr class="row-odd"><td>Blocks are manually managed? <a class="footnote-reference" href="#id31" id="id18">[10]</a></td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
</tr>
|
|
<tr class="row-even"><td>Blocks are scanned? <a class="footnote-reference" href="#id32" id="id19">[11]</a></td>
|
|
<td>yes</td>
|
|
<td>no</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>yes</td>
|
|
</tr>
|
|
<tr class="row-odd"><td>Blocks support base pointers only? <a class="footnote-reference" href="#id33" id="id20">[12]</a></td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>yes</td>
|
|
</tr>
|
|
<tr class="row-even"><td>Blocks support internal pointers? <a class="footnote-reference" href="#id33" id="id21">[12]</a></td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>no</td>
|
|
</tr>
|
|
<tr class="row-odd"><td>Blocks may be protected by barriers?</td>
|
|
<td>yes</td>
|
|
<td>no</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>yes</td>
|
|
</tr>
|
|
<tr class="row-even"><td>Blocks may move?</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
</tr>
|
|
<tr class="row-odd"><td>Blocks may be finalized?</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
</tr>
|
|
<tr class="row-even"><td>Blocks must be formatted? <a class="footnote-reference" href="#id32" id="id22">[11]</a></td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>no</td>
|
|
<td>yes</td>
|
|
</tr>
|
|
<tr class="row-odd"><td>Blocks may belong to format auto-header?</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>yes</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>—</td>
|
|
<td>no</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div class="admonition-note admonition">
|
|
<p class="first admonition-title">Notes</p>
|
|
<table class="docutils footnote" frame="void" id="id23" rules="none">
|
|
<colgroup><col class="label" /><col /></colgroup>
|
|
<tbody valign="top">
|
|
<tr><td class="label"><a class="fn-backref" href="#id5">[2]</a></td><td>“Timing of collections” is “auto” if <a class="reference internal" href="../glossary/g.html#term-garbage-collection"><em class="xref std std-term">garbage collection</em></a>
|
|
is under the control of the MPS, which decides when collection
|
|
should take place and performs it <a class="reference internal" href="../glossary/a.html#term-automatic-memory-management"><em class="xref std std-term">automatically</em></a> and <a class="reference internal" href="../glossary/i.html#term-incremental-garbage-collection"><em class="xref std std-term">incrementally</em></a>.</td></tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="docutils footnote" frame="void" id="id24" rules="none">
|
|
<colgroup><col class="label" /><col /></colgroup>
|
|
<tbody valign="top">
|
|
<tr><td class="label"><a class="fn-backref" href="#id6">[3]</a></td><td>The references in question are references to blocks in
|
|
<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"><em class="xref std std-term">pools</em></a>.</td></tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="docutils footnote" frame="void" id="id25" rules="none">
|
|
<colgroup><col class="label" /><col /></colgroup>
|
|
<tbody valign="top">
|
|
<tr><td class="label">[4]</td><td><em>(<a class="fn-backref" href="#id7">1</a>, <a class="fn-backref" href="#id8">2</a>, <a class="fn-backref" href="#id9">3</a>)</em> Pools “may contain <a class="reference internal" href="../glossary/a.html#term-ambiguous-reference"><em class="xref std std-term">ambiguous</em></a> /
|
|
<a class="reference internal" href="../glossary/e.html#term-exact-reference"><em class="xref std std-term">exact</em></a> / <a class="reference internal" href="../glossary/w.html#term-weak-reference-1"><em class="xref std std-term">weak</em></a> references” if the references that the client
|
|
program fixes during scanning may include references of the
|
|
indicated <a class="reference internal" href="../glossary/r.html#term-rank"><em class="xref std std-term">rank</em></a>.</td></tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="docutils footnote" frame="void" id="id26" rules="none">
|
|
<colgroup><col class="label" /><col /></colgroup>
|
|
<tbody valign="top">
|
|
<tr><td class="label"><a class="fn-backref" href="#id10">[5]</a></td><td>“Alignment” is “conf” if the client program may specify
|
|
<a class="reference internal" href="../glossary/a.html#term-alignment"><em class="xref std std-term">alignment</em></a> for each pool.</td></tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="docutils footnote" frame="void" id="id27" rules="none">
|
|
<colgroup><col class="label" /><col /></colgroup>
|
|
<tbody valign="top">
|
|
<tr><td class="label">[6]</td><td><em>(<a class="fn-backref" href="#id11">1</a>, <a class="fn-backref" href="#id12">2</a>, <a class="fn-backref" href="#id14">3</a>)</em> The alignment of blocks allocated from <a class="reference internal" href="mv.html#pool-mv"><em>MV (Manual Variable)</em></a> and
|
|
<a class="reference internal" href="mvt.html#pool-mvt"><em>MVT (Manual Variable Temporal)</em></a> pools is platform-dependent.</td></tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="docutils footnote" frame="void" id="id28" rules="none">
|
|
<colgroup><col class="label" /><col /></colgroup>
|
|
<tbody valign="top">
|
|
<tr><td class="label"><a class="fn-backref" href="#id13">[7]</a></td><td><a class="reference internal" href="mvff.html#pool-mvff"><em>MVFF (Manual Variable First Fit)</em></a> pools have configurable alignment, but it
|
|
may not be smaller than the <a class="reference internal" href="../glossary/n.html#term-natural-alignment"><em class="xref std std-term">natural alignment</em></a> for
|
|
the <a class="reference internal" href="../glossary/p.html#term-platform"><em class="xref std std-term">platform</em></a> (see <a class="reference internal" href="../topic/platform.html#MPS_PF_ALIGN" title="MPS_PF_ALIGN"><tt class="xref c c-macro docutils literal"><span class="pre">MPS_PF_ALIGN</span></tt></a>).</td></tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="docutils footnote" frame="void" id="id29" rules="none">
|
|
<colgroup><col class="label" /><col /></colgroup>
|
|
<tbody valign="top">
|
|
<tr><td class="label"><a class="fn-backref" href="#id15">[8]</a></td><td>In pools with this property, each object may specify an
|
|
<a class="reference internal" href="../glossary/d.html#term-dependent-object"><em class="xref std std-term">dependent object</em></a> which the client program
|
|
guarantees will be accessible during the scanning of the
|
|
first object. This may be used in the implementation of
|
|
<a class="reference internal" href="../glossary/w.html#term-weak-hash-table"><em class="xref std std-term">weak hash tables</em></a>.</td></tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="docutils footnote" frame="void" id="id30" rules="none">
|
|
<colgroup><col class="label" /><col /></colgroup>
|
|
<tbody valign="top">
|
|
<tr><td class="label"><a class="fn-backref" href="#id16">[9]</a></td><td>“Remote references” are references that are stored outside the
|
|
block to which they logically belong (for example, in some kind
|
|
of auxiliary table). A pool containing remote references cannot
|
|
rely on a <a class="reference internal" href="../glossary/w.html#term-write-barrier"><em class="xref std std-term">write barrier</em></a> to detect changed references.</td></tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="docutils footnote" frame="void" id="id31" rules="none">
|
|
<colgroup><col class="label" /><col /></colgroup>
|
|
<tbody valign="top">
|
|
<tr><td class="label">[10]</td><td><em>(<a class="fn-backref" href="#id17">1</a>, <a class="fn-backref" href="#id18">2</a>)</em> Blocks are “automatically managed” if they may be
|
|
automatically discarded when the MPS determines that they
|
|
are unreachable; they are “manually managed” if they can be
|
|
discarded when the <a class="reference internal" href="../glossary/c.html#term-client-program"><em class="xref std std-term">client program</em></a> requests it. Note
|
|
that these properties are not mutually exclusive, although
|
|
the MPS does not provide a pool class that satisfies both.</td></tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="docutils footnote" frame="void" id="id32" rules="none">
|
|
<colgroup><col class="label" /><col /></colgroup>
|
|
<tbody valign="top">
|
|
<tr><td class="label">[11]</td><td><em>(<a class="fn-backref" href="#id19">1</a>, <a class="fn-backref" href="#id22">2</a>)</em> Blocks “are scanned” if the MPS <a class="reference internal" href="../glossary/s.html#term-scan"><em class="xref std std-term">scans</em></a> them for
|
|
references; blocks “must be formatted” if they are
|
|
described to the MPS by an <a class="reference internal" href="../glossary/o.html#term-object-format"><em class="xref std std-term">object format</em></a>. At
|
|
present, the MPS only knows how to scan blocks using the
|
|
<a class="reference internal" href="../glossary/s.html#term-scan-method"><em class="xref std std-term">scan method</em></a> from an object format, but the MPS
|
|
design does not preclude pools that scan unformatted
|
|
blocks.</td></tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="last docutils footnote" frame="void" id="id33" rules="none">
|
|
<colgroup><col class="label" /><col /></colgroup>
|
|
<tbody valign="top">
|
|
<tr><td class="label">[12]</td><td><em>(<a class="fn-backref" href="#id20">1</a>, <a class="fn-backref" href="#id21">2</a>)</em> A block “supports internal pointers” if a pointer to any
|
|
location within the block is considered to be a reference
|
|
to the block. It “supports base pointers only” if only a
|
|
pointer to the base of the block (or, if the block belongs
|
|
to an object format of variant auto-header, a pointer just
|
|
past the end of the header) is considered to be a reference
|
|
to the block.</td></tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="writing-a-new-pool-class">
|
|
<span id="pool-writing"></span><span id="index-2"></span><h1>3. Writing a new pool class<a class="headerlink" href="#writing-a-new-pool-class" title="Permalink to this headline">¶</a></h1>
|
|
<p>If none of the pool classes supplied with the MPS are quite right for
|
|
your application, don’t despair: the MPS is designed to be extensible
|
|
with new pool classes, and designed so that the properties of pools
|
|
are as orthogonal as possible. So if you need a pool containing
|
|
objects that are scannable but unformatted, or movable objects which
|
|
are manually managed, or a pool all of whose objects are roots, there
|
|
is no technical reason why it should not be possible to write it.</p>
|
|
<p>If you’d be interested in our developing new pool classes for your
|
|
requirements, or if you’ve started writing a new pool class
|
|
yourself, <a class="reference internal" href="../contact.html#contact"><em>we’d love to hear from you</em></a>.</p>
|
|
</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="#">1. Choosing a pool class</a></li>
|
|
<li><a class="reference internal" href="#pool-class-properties">2. Pool class properties</a></li>
|
|
<li><a class="reference internal" href="#writing-a-new-pool-class">3. Writing a new pool class</a></li>
|
|
</ul>
|
|
|
|
<h4>Previous topic</h4>
|
|
<p class="topless"><a href="index.html"
|
|
title="previous chapter">Pool reference</a></p>
|
|
<h4>Next topic</h4>
|
|
<p class="topless"><a href="amc.html"
|
|
title="next chapter">4. AMC (Automatic Mostly-Copying)</a></p><h4>Downloads</h4>
|
|
|
|
<p class="topless">
|
|
<a href="http://www.ravenbrook.com/project/mps/release/1.111.0/">MPS Kit release 1.111.0</a><br>
|
|
<a href="http://www.ravenbrook.com/project/mps/release/">All MPS Kit releases</a>
|
|
</p>
|
|
|
|
<h4>Issues</h4>
|
|
|
|
<p class="topless">
|
|
<a href="http://www.ravenbrook.com/project/mps/issue/?action=list&view=status%3dopen&display=Job:Priority:Title&sort=Priority">Known issues</a><br>
|
|
<a href="http://www.ravenbrook.com/project/mps/issue/?action=fixed&release_fixed=1.111.0">Issues fixed in release 1.111.0</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="amc.html" title="4. AMC (Automatic Mostly-Copying)"
|
|
>next</a> |</li>
|
|
<li class="right" >
|
|
<a href="index.html" title="Pool reference"
|
|
>previous</a> |</li>
|
|
<li><a href="../index.html">Memory Pool System 1.111.0 documentation</a> »</li>
|
|
<li><a href="index.html" >Pool reference</a> »</li>
|
|
</ul>
|
|
</div>
|
|
<div class="footer">
|
|
© <a href="../copyright.html">Copyright</a> 2013, Ravenbrook Limited.
|
|
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
|
|
</div>
|
|
</body>
|
|
</html> |