diff options
author | Phil Edwards <pme@gcc.gnu.org> | 2001-11-29 21:02:34 +0000 |
---|---|---|
committer | Phil Edwards <pme@gcc.gnu.org> | 2001-11-29 21:02:34 +0000 |
commit | 894c7af33d49598598ac8b82a6104ea25e18957a (patch) | |
tree | d49bb31b18c59800d503e84bf135ef196ff30e79 /libstdc++-v3/docs | |
parent | b67db52985b8ed3a7b4a32f7948b50e6bff6f6b1 (diff) | |
download | gcc-894c7af33d49598598ac8b82a6104ea25e18957a.zip gcc-894c7af33d49598598ac8b82a6104ea25e18957a.tar.gz gcc-894c7af33d49598598ac8b82a6104ea25e18957a.tar.bz2 |
howto.html: Finish allocator notes (inst and 3.0).
2001-11-29 Phil Edwards <pme@gcc.gnu.org>
* docs/html/ext/howto.html: Finish allocator notes (inst and 3.0).
From-SVN: r47452
Diffstat (limited to 'libstdc++-v3/docs')
-rw-r--r-- | libstdc++-v3/docs/html/ext/howto.html | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/libstdc++-v3/docs/html/ext/howto.html b/libstdc++-v3/docs/html/ext/howto.html index 53c2949..e5518cf 100644 --- a/libstdc++-v3/docs/html/ext/howto.html +++ b/libstdc++-v3/docs/html/ext/howto.html @@ -276,6 +276,9 @@ <code>__alloc</code> should not be noticably slower than <code>__single_client_alloc</code>.) </p> + <p>[Another threadsafe allocator where each thread keeps its own free + list, so that no locking is needed, might be described here.] + </p> <h3>A cannon to swat a fly:<code> __USE_MALLOC</code></h3> <p>If you've already read <a href="../23_containers/howto.html#3">this advice</a> and decided to define this macro, then the situation changes @@ -320,16 +323,30 @@ <code>__default_alloc_template</code> classes take an integer parameter, called inst here. This number is completely unused. </p> - <p> More soon. + <p>The point of the number is to allow multiple instantiations of the + classes without changing the semantics at all. All three of + <pre> + typedef __default_alloc_template<true,0> normal; + typedef __default_alloc_template<true,1> private; + typedef __default_alloc_template<true,42> also_private;</pre> + behave exactly the same way. However, the memory pool for each type + (and remember that different instantiations result in different types) + remains separate. </p> - <p> + <p>The library uses <strong>0</strong> in all its instantiations. If you + wish to keep separate free lists for a particular purpose, use a + different number. </p> <h3>3.0.x</h3> - <p>I don't even remember. More soon. + <p>For 3.0.x, many of the names were incorrectly <em>not</em> prefixed + with underscores. So symbols such as "std::single_client_alloc" + are present. Be very careful to not depend on these names any more + than you would depend on implementation-only names. </p> - <p> + <p>Certain macros like <code>_NOTHREADS</code> and <code>__STL_THREADS</code> + can affect the 3.0.x allocators. Do not use them. </p> - <p> + <p>More notes as we remember them... </p> <p>Return <a href="#top">to top of page</a> or <a href="../faq/index.html">to the FAQ</a>. |