From 894c7af33d49598598ac8b82a6104ea25e18957a Mon Sep 17 00:00:00 2001 From: Phil Edwards Date: Thu, 29 Nov 2001 21:02:34 +0000 Subject: [PATCH] howto.html: Finish allocator notes (inst and 3.0). 2001-11-29 Phil Edwards * docs/html/ext/howto.html: Finish allocator notes (inst and 3.0). From-SVN: r47452 --- libstdc++-v3/ChangeLog | 4 ++++ libstdc++-v3/docs/html/ext/howto.html | 27 ++++++++++++++++++++++----- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 083f412..58e899f 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,7 @@ +2001-11-29 Phil Edwards + + * docs/html/ext/howto.html: Finish allocator notes (inst and 3.0). + 2001-11-29 Benjamin Kosnik * include/bits/locale_facets.tcc (num_get::do_get(long double)): 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 @@ __alloc should not be noticably slower than __single_client_alloc.)

+

[Another threadsafe allocator where each thread keeps its own free + list, so that no locking is needed, might be described here.] +

A cannon to swat a fly: __USE_MALLOC

If you've already read this advice and decided to define this macro, then the situation changes @@ -320,16 +323,30 @@ __default_alloc_template classes take an integer parameter, called inst here. This number is completely unused.

-

More soon. +

The point of the number is to allow multiple instantiations of the + classes without changing the semantics at all. All three of +

+    typedef  __default_alloc_template<true,0>    normal;
+    typedef  __default_alloc_template<true,1>    private;
+    typedef  __default_alloc_template<true,42>   also_private;
+ behave exactly the same way. However, the memory pool for each type + (and remember that different instantiations result in different types) + remains separate.

-

+

The library uses 0 in all its instantiations. If you + wish to keep separate free lists for a particular purpose, use a + different number.

3.0.x

-

I don't even remember. More soon. +

For 3.0.x, many of the names were incorrectly not 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.

-

+

Certain macros like _NOTHREADS and __STL_THREADS + can affect the 3.0.x allocators. Do not use them.

-

+

More notes as we remember them...

Return to top of page or to the FAQ. -- 2.7.4