diff options
author | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-12-18 11:08:33 +0000 |
---|---|---|
committer | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-12-18 11:08:33 +0000 |
commit | 26331a7a2729ddd60edaa83a9db55f293d7b30ea (patch) | |
tree | a512621844e4d61d6edf513b4b29f7b18d4917ca /libstdc++-v3/doc/html/manual/mt_allocator_design.html | |
parent | 11833cca5c63a5d9e65af0f84fc62bfdef20d610 (diff) | |
download | gcc-26331a7a2729ddd60edaa83a9db55f293d7b30ea.tar.gz |
* doc/xml/manual/abi.xml: Update URLs for C++ ABI.
* doc/xml/manual/policy_data_structures_biblio.xml: Add xmlns
attribute.
* doc/xml/manual/debug_mode.xml: Give filenames to chunks.
* doc/xml/manual/diagnostics.xml: Likewise.
* doc/xml/manual/extensions.xml: Likewise.
* doc/xml/manual/bitmap_allocator.xml: Likewise.
* doc/xml/manual/mt_allocator.xml: Likewise.
* doc/xml/manual/policy_data_structures.xml: Likewise.
* doc/xml/manual/parallel_mode.xml: Likewise.
* doc/xml/manual/profile_mode.xml: Likewise.
* doc/xml/manual/spine.xml: Likewise. Update copyright years.
* doc/html/*: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194576 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/doc/html/manual/mt_allocator_design.html')
-rw-r--r-- | libstdc++-v3/doc/html/manual/mt_allocator_design.html | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/libstdc++-v3/doc/html/manual/mt_allocator_design.html b/libstdc++-v3/doc/html/manual/mt_allocator_design.html new file mode 100644 index 00000000000..9cb6e231cb2 --- /dev/null +++ b/libstdc++-v3/doc/html/manual/mt_allocator_design.html @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!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>Design Issues</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="mt_allocator.html" title="Chapter 20. The mt_allocator" /><link rel="prev" href="mt_allocator.html" title="Chapter 20. The mt_allocator" /><link rel="next" href="mt_allocator_impl.html" title="Implementation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design Issues</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator.html">Prev</a> </td><th width="60%" align="center">Chapter 20. The mt_allocator</th><td width="20%" align="right"> <a accesskey="n" href="mt_allocator_impl.html">Next</a></td></tr></table><hr /></div><div class="section" title="Design Issues"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.mt.design_issues"></a>Design Issues</h2></div></div></div><div class="section" title="Overview"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.overview"></a>Overview</h3></div></div></div><p> There are three general components to the allocator: a datum +describing the characteristics of the memory pool, a policy class +containing this pool that links instantiation types to common or +individual pools, and a class inheriting from the policy class that is +the actual allocator. +</p><p>The datum describing pools characteristics is +</p><pre class="programlisting"> + template<bool _Thread> + class __pool +</pre><p> This class is parametrized on thread support, and is explicitly +specialized for both multiple threads (with <code class="code">bool==true</code>) +and single threads (via <code class="code">bool==false</code>.) It is possible to +use a custom pool datum instead of the default class that is provided. +</p><p> There are two distinct policy classes, each of which can be used +with either type of underlying pool datum. +</p><pre class="programlisting"> + template<bool _Thread> + struct __common_pool_policy + + template<typename _Tp, bool _Thread> + struct __per_type_pool_policy +</pre><p> The first policy, <code class="code">__common_pool_policy</code>, implements a +common pool. This means that allocators that are instantiated with +different types, say <code class="code">char</code> and <code class="code">long</code> will both +use the same pool. This is the default policy. +</p><p> The second policy, <code class="code">__per_type_pool_policy</code>, implements +a separate pool for each instantiating type. Thus, <code class="code">char</code> +and <code class="code">long</code> will use separate pools. This allows per-type +tuning, for instance. +</p><p> Putting this all together, the actual allocator class is +</p><pre class="programlisting"> + template<typename _Tp, typename _Poolp = __default_policy> + class __mt_alloc : public __mt_alloc_base<_Tp>, _Poolp +</pre><p> This class has the interface required for standard library allocator +classes, namely member functions <code class="code">allocate</code> and +<code class="code">deallocate</code>, plus others. +</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="mt_allocator.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="mt_allocator.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="mt_allocator_impl.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 20. The mt_allocator </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Implementation</td></tr></table></div></body></html> |