]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
std_bitset.h: Use GLIBCPP in multiple-inclusion guard.
authorPhil Edwards <pme@gcc.gnu.org>
Thu, 6 Dec 2001 20:29:31 +0000 (20:29 +0000)
committerPhil Edwards <pme@gcc.gnu.org>
Thu, 6 Dec 2001 20:29:31 +0000 (20:29 +0000)
2001-12-06  Phil Edwards  <pme@gcc.gnu.org>

* include/bits/std_bitset.h:  Use GLIBCPP in multiple-inclusion guard.
* include/bits/stl_algo.h:  Likewise.
* include/bits/stl_algobase.h:  Likewise.
* include/bits/stl_bvector.h:  Likewise.
* include/bits/stl_deque.h:  Likewise.
* include/bits/stl_function.h:  Likewise.
* include/bits/stl_iterator.h:  Likewise.
* include/bits/stl_iterator_base_funcs.h:  Likewise.
* include/bits/stl_iterator_base_types.h:  Likewise.
* include/bits/stl_list.h:  Likewise.
* include/bits/stl_multimap.h:  Likewise.
* include/bits/stl_multiset.h:  Likewise.
* include/bits/stl_pair.h:  Likewise.
* include/bits/stl_queue.h:  Likewise.
* include/bits/stl_set.h:  Likewise.
* include/bits/stl_stack.h:  Likewise.
* include/bits/stl_tempbuf.h:  Likewise.
* include/bits/stl_tree.h:  Likewise.
* include/bits/stl_vector.h:  Likewise.

* include/bits/stl_alloc.h:  Use our own multiple inclusion guards.
Doxygenate more comments.  Correct historical artifacts in comments.
(alloc, single_alloc):  Uglify non-standard names.
(__default_alloc_template::_NFREELISTS):  Calculate from other
parameters.
(__default_alloc_template::_S_free_list):  Remove SunPro workaround.
(__default_alloc_template::_Lock):  Mark as "unused".
* include/backward/alloc.h:  Update.
* include/bits/stl_bvector.h:  Likewise.
* include/ext/ropeimpl.h:  Likewise.
* include/ext/stl_hashtable.h:  Likewise.

From-SVN: r47729

24 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/backward/alloc.h
libstdc++-v3/include/bits/std_bitset.h
libstdc++-v3/include/bits/stl_algo.h
libstdc++-v3/include/bits/stl_algobase.h
libstdc++-v3/include/bits/stl_alloc.h
libstdc++-v3/include/bits/stl_bvector.h
libstdc++-v3/include/bits/stl_deque.h
libstdc++-v3/include/bits/stl_function.h
libstdc++-v3/include/bits/stl_iterator.h
libstdc++-v3/include/bits/stl_iterator_base_funcs.h
libstdc++-v3/include/bits/stl_iterator_base_types.h
libstdc++-v3/include/bits/stl_list.h
libstdc++-v3/include/bits/stl_multimap.h
libstdc++-v3/include/bits/stl_multiset.h
libstdc++-v3/include/bits/stl_pair.h
libstdc++-v3/include/bits/stl_queue.h
libstdc++-v3/include/bits/stl_set.h
libstdc++-v3/include/bits/stl_stack.h
libstdc++-v3/include/bits/stl_tempbuf.h
libstdc++-v3/include/bits/stl_tree.h
libstdc++-v3/include/bits/stl_vector.h
libstdc++-v3/include/ext/ropeimpl.h
libstdc++-v3/include/ext/stl_hashtable.h

index 08d0eb8cf1842c592b7b8bdc34dc85db1083364a..b5dfa19c71e3d932da19b907b4edebef63939cfb 100644 (file)
@@ -1,3 +1,37 @@
+2001-12-06  Phil Edwards  <pme@gcc.gnu.org>
+
+       * include/bits/std_bitset.h:  Use GLIBCPP in multiple-inclusion guard.
+       * include/bits/stl_algo.h:  Likewise.
+       * include/bits/stl_algobase.h:  Likewise.
+       * include/bits/stl_bvector.h:  Likewise.
+       * include/bits/stl_deque.h:  Likewise.
+       * include/bits/stl_function.h:  Likewise.
+       * include/bits/stl_iterator.h:  Likewise.
+       * include/bits/stl_iterator_base_funcs.h:  Likewise.
+       * include/bits/stl_iterator_base_types.h:  Likewise.
+       * include/bits/stl_list.h:  Likewise.
+       * include/bits/stl_multimap.h:  Likewise.
+       * include/bits/stl_multiset.h:  Likewise.
+       * include/bits/stl_pair.h:  Likewise.
+       * include/bits/stl_queue.h:  Likewise.
+       * include/bits/stl_set.h:  Likewise.
+       * include/bits/stl_stack.h:  Likewise.
+       * include/bits/stl_tempbuf.h:  Likewise.
+       * include/bits/stl_tree.h:  Likewise.
+       * include/bits/stl_vector.h:  Likewise.
+
+       * include/bits/stl_alloc.h:  Use our own multiple inclusion guards.
+       Doxygenate more comments.  Correct historical artifacts in comments.
+       (alloc, single_alloc):  Uglify non-standard names.
+       (__default_alloc_template::_NFREELISTS):  Calculate from other
+       parameters.
+       (__default_alloc_template::_S_free_list):  Remove SunPro workaround.
+       (__default_alloc_template::_Lock):  Mark as "unused".
+       * include/backward/alloc.h:  Update.
+       * include/bits/stl_bvector.h:  Likewise.
+       * include/ext/ropeimpl.h:  Likewise.
+       * include/ext/stl_hashtable.h:  Likewise.
+
 2001-12-05  Benjamin Kosnik  <bkoz@redhat.com>
 
        DR/282
index d4086410a8ef69c940c90ff99bac63557e4ea97c..4344a1d902c9a6ac7ea5e28686374c282c34158d 100644 (file)
@@ -50,8 +50,8 @@
 using std::__malloc_alloc_template; 
 using std::__simple_alloc; 
 using std::__debug_alloc; 
-using std::alloc; 
-using std::single_client_alloc; 
+using std::__alloc; 
+using std::__single_client_alloc; 
 using std::allocator;
 #ifdef __USE_MALLOC
 using std::malloc_alloc; 
index 14b5051e456a0cf7407a6085f969648a94c21784..67647ced72c6a380aa5291bb6a03e4bc2fd17a9f 100644 (file)
@@ -45,8 +45,8 @@
  *  You should not attempt to use it directly.
  */
 
-#ifndef __SGI_STL_BITSET
-#define __SGI_STL_BITSET
+#ifndef __GLIBCPP_BITSET
+#define __GLIBCPP_BITSET
 
 #pragma GCC system_header
 
@@ -805,7 +805,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Nb>& __x)
 
 #undef __BITSET_WORDS
 
-#endif /* __SGI_STL_BITSET */
+#endif /* __GLIBCPP_BITSET */
 
 
 // Local Variables:
index c909f11a890be52a857cc8841ee15b41684e2b56..1afadfa3fe8a4f2a47f26ba5969b39adb38e1bcb 100644 (file)
@@ -58,8 +58,8 @@
  *  You should not attempt to use it directly.
  */
 
-#ifndef __SGI_STL_INTERNAL_ALGO_H
-#define __SGI_STL_INTERNAL_ALGO_H
+#ifndef __GLIBCPP_INTERNAL_ALGO_H
+#define __GLIBCPP_INTERNAL_ALGO_H
 
 #include <bits/stl_heap.h>
 
@@ -3601,7 +3601,7 @@ __result, __binary_pred, _IterType());
 
 } // namespace std
 
-#endif /* __SGI_STL_INTERNAL_ALGO_H */
+#endif /* __GLIBCPP_INTERNAL_ALGO_H */
 
 // Local Variables:
 // mode:C++
index b252eea426fb004a2a56a8ce2b260cafb470eaac..b75a80835d3e82d4fda2585fce8fbe8c047f6c2a 100644 (file)
@@ -58,8 +58,8 @@
  *  You should not attempt to use it directly.
  */
 
-#ifndef __SGI_STL_INTERNAL_ALGOBASE_H
-#define __SGI_STL_INTERNAL_ALGOBASE_H
+#ifndef __GLIBCPP_INTERNAL_ALGOBASE_H
+#define __GLIBCPP_INTERNAL_ALGOBASE_H
 
 #include <bits/c++config.h>
 #include <bits/stl_pair.h>
@@ -950,7 +950,7 @@ namespace std
 
 } // namespace std
 
-#endif /* __SGI_STL_INTERNAL_ALGOBASE_H */
+#endif /* __GLIBCPP_INTERNAL_ALGOBASE_H */
 
 // Local Variables:
 // mode:C++
index e14edca13e0293902d73c97773be18345cd21dd9..b1dc11e8af0c581cef1a4e1077bfdb4e5b824824 100644 (file)
  *  You should not attempt to use it directly.
  */
 
-#ifndef __SGI_STL_INTERNAL_ALLOC_H
-#define __SGI_STL_INTERNAL_ALLOC_H
-
-// This header implements some node allocators.  These are NOT the same as
-// allocators in the C++ standard, nor in the original HP STL.  They do not
-// encapsulate different pointer types; we assume that there is only one
-// pointer type.  The C++ standard allocators are intended to allocate
-// individual objects, not pools or arenas.
-//
-// In this file allocators are of two different styles:  "standard" and
-// "SGI" (quotes included).  "Standard" allocators conform to 20.4.  "SGI"
-// allocators differ in AT LEAST the following ways (add to this list as you
-// discover them):
-//
-//  - "Standard" allocate() takes two parameters (n_count,hint=0) but "SGI"
-//    allocate() takes one paramter (n_size).
-//  - Likewise, "standard" deallocate()'s n is a count, but in "SGI" is a
-//    byte size.
-//  - max_size(), construct(), and destroy() are missing in "SGI" allocators.
-//  - reallocate(p,oldsz,newsz) is added in "SGI", and behaves as
-//    if p=realloc(p,newsz).
+#ifndef __GLIBCPP_INTERNAL_ALLOC_H
+#define __GLIBCPP_INTERNAL_ALLOC_H
+
+/**
+ *  @maint
+ *  @addtogroup Allocators
+ *  stl_alloc.h implements some node allocators.  These are NOT the same as
+ *  allocators in the C++ standard, nor in the original H-P STL.  They do not
+ *  encapsulate different pointer types; we assume that there is only one
+ *  pointer type.  The C++ standard allocators are intended to allocate
+ *  individual objects, not pools or arenas.
+ *
+ *  In this file allocators are of two different styles:  "standard" and
+ *  "SGI" (quotes included).  "Standard" allocators conform to 20.4.  "SGI"
+ *  allocators differ in AT LEAST the following ways (add to this list as you
+ *  discover them):
+ *
+ *   - "Standard" allocate() takes two parameters (n_count,hint=0) but "SGI"
+ *     allocate() takes one paramter (n_size).
+ *   - Likewise, "standard" deallocate()'s argument is a count, but in "SGI"
+ *     is a byte size.
+ *   - max_size(), construct(), and destroy() are missing in "SGI" allocators.
+ *   - reallocate(p,oldsz,newsz) is added in "SGI", and behaves as
+ *     if p=realloc(p,newsz).
+ *
+ *  "SGI" allocators may be wrapped in __allocator to convert the interface
+ *  into a "standard" one.
+ *
+ *  @endmaint
+*/
 
 
 #include <bits/functexcept.h>   // for __throw_bad_alloc
@@ -82,6 +91,7 @@ namespace std
    *  A new-based allocator, as required by the standard.  Allocation and
    *  deallocation forward to global new and delete.  "SGI" style, minus
    *  reallocate().
+   *  (See @link Allocators allocators info @endlink for more.)
    *  @endmaint
   */
   class __new_alloc 
@@ -104,6 +114,7 @@ namespace std
    *  storage efficient.  The template argument is unused and is only present
    *  to permit multiple instantiations (but see __default_alloc_template
    *  for caveats).  "SGI" style, plus __set_malloc_handler for OOM conditions.
+   *  (See @link Allocators allocators info @endlink for more.)
    *  @endmaint
   */
   template <int __inst>
@@ -195,11 +206,14 @@ namespace std
 
 
   /**
+   *  @maint
    *  This is used primarily (only?) in _Alloc_traits and other places to
    *  help provide the _Alloc_type typedef.
    *
    *  This is neither "standard"-conforming nor "SGI".  The _Alloc parameter
    *  must be "SGI" style.
+   *  (See @link Allocators allocators info @endlink for more.)
+   *  @endmaint
   */
   template<class _Tp, class _Alloc>
   class __simple_alloc
@@ -220,6 +234,7 @@ namespace std
 
 
   /**
+   *  @maint
    *  An adaptor for an underlying allocator (_Alloc) to check the size
    *  arguments for debugging.  Errors are reported using assert; these
    *  checks can be disabled via NDEBUG, but the space penalty is still
@@ -229,6 +244,8 @@ namespace std
    *  "There is some evidence that this can confuse Purify." - SGI comment
    *
    *  This adaptor is "SGI" style.  The _Alloc parameter must also be "SGI".
+   *  (See @link Allocators allocators info @endlink for more.)
+   *  @endmaint
   */
   template <class _Alloc>
   class __debug_alloc
@@ -268,19 +285,21 @@ namespace std
 
 #ifdef __USE_MALLOC
 
-typedef __mem_interface alloc;
-typedef __mem_interface single_client_alloc;
+typedef __mem_interface __alloc;
+typedef __mem_interface __single_client_alloc;
 
 #else
 
 
 /**
  *  @maint
- *  Default node allocator.
+ *  Default node allocator.  "SGI" style.  Uses __mem_interface for its
+ *  underlying requests (and makes as few requests as possible).
+ *  **** Currently __mem_interface is always __new_alloc, never __malloc*.
  * 
  *  Important implementation properties:
  *  1. If the clients request an object of size > _MAX_BYTES, the resulting
- *     object will be obtained directly from malloc.
+ *     object will be obtained directly from the underlying __mem_interface.
  *  2. In all other cases, we allocate an object of size exactly
  *     _S_round_up(requested_size).  Thus the client has enough size
  *     information that we can return the object to the proper free list
@@ -297,6 +316,8 @@ typedef __mem_interface single_client_alloc;
  *  allocator instances have different types, limiting the utility of this
  *  approach.  If you do not wish to share the free lists with the main
  *  default_alloc instance, instantiate this with a non-zero __inst.
+ *
+ *  (See @link Allocators allocators info @endlink for more.)
  *  @endmaint
 */
 template <bool __threads, int __inst>
@@ -306,7 +327,7 @@ class __default_alloc_template
 private:
   enum {_ALIGN = 8};
   enum {_MAX_BYTES = 128};
-  enum {_NFREELISTS = 16}; // _MAX_BYTES/_ALIGN
+  enum {_NFREELISTS = _MAX_BYTES / _ALIGN};
 
   static size_t
   _S_round_up(size_t __bytes) 
@@ -334,16 +355,14 @@ private:
 
   static _STL_mutex_lock _S_node_allocator_lock;
 
-  // It would be nice to use _STL_auto_lock here.  But we
-  // don't need the NULL check.  And we do need a test whether
-  // threads have actually been started.
-  class _Lock;
-  friend class _Lock;
+  // It would be nice to use _STL_auto_lock here.  But we need a test whether
+  // threads are in use.
   class _Lock {
     public:
       _Lock() { if (__threads) _S_node_allocator_lock._M_acquire_lock(); }
       ~_Lock() { if (__threads) _S_node_allocator_lock._M_release_lock(); }
-  };
+  } __attribute__ ((__unused__));
+  friend class _Lock;
 
 public:
 
@@ -357,9 +376,8 @@ public:
     else 
       {
        _Obj* volatile* __my_free_list = _S_free_list + _S_freelist_index(__n);
-       // Acquire the lock here with a constructor call.
-       // This ensures that it is released in exit or during stack
-       // unwinding.
+       // Acquire the lock here with a constructor call.  This ensures that
+       // it is released in exit or during stack unwinding.
        _Lock __lock_instance;
        _Obj* __restrict__ __result = *__my_free_list;
        if (__result == 0)
@@ -385,11 +403,11 @@ public:
           = _S_free_list + _S_freelist_index(__n);
        _Obj* __q = (_Obj*)__p;
        
-       // acquire lock
+       // Acquire the lock here with a constructor call.  This ensures that
+       // it is released in exit or during stack unwinding.
        _Lock __lock_instance;
        __q -> _M_free_list_link = *__my_free_list;
        *__my_free_list = __q;
-       // lock is released here
       }
   }
   
@@ -477,9 +495,8 @@ __default_alloc_template<__threads, __inst>::_S_chunk_alloc(size_t __size,
              }
            _S_end_free = 0;    // In case of exception.
             _S_start_free = (char*)__mem_interface::allocate(__bytes_to_get);
-            // This should either throw an
-            // exception or remedy the situation.  Thus we assume it
-            // succeeded.
+            // This should either throw an exception or remedy the situation.
+            // Thus we assume it succeeded.
          }
         _S_heap_size += __bytes_to_get;
         _S_end_free = _S_start_free + __bytes_to_get;
@@ -543,9 +560,9 @@ __default_alloc_template<threads, inst>::reallocate(void* __p,
 }
 
 template <bool __threads, int __inst>
-_STL_mutex_lock
-__default_alloc_template<__threads, __inst>::_S_node_allocator_lock
-  __STL_MUTEX_INITIALIZER;
+  _STL_mutex_lock
+  __default_alloc_template<__threads, __inst>::_S_node_allocator_lock
+    __STL_MUTEX_INITIALIZER;
 
 template <bool __threads, int __inst>
 char* __default_alloc_template<__threads, __inst>::_S_start_free = 0;
@@ -559,12 +576,11 @@ size_t __default_alloc_template<__threads, __inst>::_S_heap_size = 0;
 template <bool __threads, int __inst>
 typename __default_alloc_template<__threads, __inst>::_Obj* volatile
 __default_alloc_template<__threads, __inst> ::_S_free_list[
-    __default_alloc_template<__threads, __inst>::_NFREELISTS
-] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+    __default_alloc_template<__threads, __inst>::_NFREELISTS ];
 
 
-typedef __default_alloc_template<true, 0> alloc;
-typedef __default_alloc_template<false, 0> single_client_alloc;
+typedef __default_alloc_template<true, 0>    __alloc;
+typedef __default_alloc_template<false, 0>   __single_client_alloc;
 
 
 #endif /* ! __USE_MALLOC */
@@ -580,15 +596,16 @@ typedef __default_alloc_template<false, 0> single_client_alloc;
  *    - __malloc_alloc_template is used for memory requests
  *  - else (the default)
  *    - __default_alloc_template is used via two typedefs
- *    - "single_client_alloc" typedef does no locking for threads
- *    - "alloc" typedef is threadsafe via the locks
+ *    - "__single_client_alloc" typedef does no locking for threads
+ *    - "__alloc" typedef is threadsafe via the locks
  *    - __new_alloc is used for memory requests
  *
+ *  (See @link Allocators allocators info @endlink for more.)
 */
 template <class _Tp>
 class allocator
 {
-  typedef alloc _Alloc;          // The underlying allocator.
+  typedef __alloc _Alloc;          // The underlying allocator.
 public:
   typedef size_t     size_type;
   typedef ptrdiff_t  difference_type;
@@ -657,12 +674,13 @@ inline bool operator!=(const allocator<_T1>&, const allocator<_T2>&)
 
 
 /**
- *  Allocator adaptor to turn an "SGI" style allocator (e.g. alloc,
- *  __malloc_alloc_template) into a "standard" conformaing allocator.  Note
+ *  Allocator adaptor to turn an "SGI" style allocator (e.g., __alloc,
+ *  __malloc_alloc_template) into a "standard" conforming allocator.  Note
  *  that this adaptor does *not* assume that all objects of the underlying
  *  alloc class are identical, nor does it assume that all of the underlying
  *  alloc's member functions are static member functions.  Note, also, that
- *  __allocator<_Tp, alloc> is essentially the same thing as allocator<_Tp>.
+ *  __allocator<_Tp, __alloc> is essentially the same thing as allocator<_Tp>.
+ *  (See @link Allocators allocators info @endlink for more.)
 */
 template <class _Tp, class _Alloc>
 struct __allocator
@@ -738,10 +756,11 @@ inline bool operator!=(const __allocator<_Tp, _Alloc>& __a1,
 }
 
 
-// Comparison operators for all of the predifined SGI-style allocators.
-// This ensures that __allocator<malloc_alloc> (for example) will
-// work correctly.
-
+//@{
+/** Comparison operators for all of the predifined SGI-style allocators.
+ *  This ensures that __allocator<malloc_alloc> (for example) will work
+ *  correctly.  As required, all allocators compare equal.
+*/
 template <int inst>
 inline bool operator==(const __malloc_alloc_template<inst>&,
                        const __malloc_alloc_template<inst>&)
@@ -767,36 +786,46 @@ inline bool operator!=(const __debug_alloc<_Alloc>&,
                        const __debug_alloc<_Alloc>&) {
   return false;
 }
+//@}
 
 
-// Another allocator adaptor: _Alloc_traits.  This serves two
-// purposes.  First, make it possible to write containers that can use
-// either SGI-style allocators or standard-conforming allocator.
-// Second, provide a mechanism so that containers can query whether or
-// not the allocator has distinct instances.  If not, the container
-// can avoid wasting a word of memory to store an empty object.
-
-// This adaptor uses partial specialization.  The general case of
-// _Alloc_traits<_Tp, _Alloc> assumes that _Alloc is a
-// standard-conforming allocator, possibly with non-equal instances
-// and non-static members.  (It still behaves correctly even if _Alloc
-// has static member and if all instances are equal.  Refinements
-// affect performance, not correctness.)
-
-// There are always two members: allocator_type, which is a standard-
-// conforming allocator type for allocating objects of type _Tp, and
-// _S_instanceless, a static const member of type bool.  If
-// _S_instanceless is true, this means that there is no difference
-// between any two instances of type allocator_type.  Furthermore, if
-// _S_instanceless is true, then _Alloc_traits has one additional
-// member: _Alloc_type.  This type encapsulates allocation and
-// deallocation of objects of type _Tp through a static interface; it
-// has two member functions, whose signatures are
-//    static _Tp* allocate(size_t)
-//    static void deallocate(_Tp*, size_t)
-
+/**
+ *  @maint
+ *  Another allocator adaptor:  _Alloc_traits.  This serves two purposes.
+ *  First, make it possible to write containers that can use either "SGI"
+ *  style allocators or "standard" allocators.  Second, provide a mechanism
+ *  so that containers can query whether or not the allocator has distinct
+ *  instances.  If not, the container can avoid wasting a word of memory to
+ *  store an empty object.  For examples of use, see stl_vector.h, etc, or
+ *  any of the other classes derived from this one.
+ *
+ *  This adaptor uses partial specialization.  The general case of
+ *  _Alloc_traits<_Tp, _Alloc> assumes that _Alloc is a
+ *  standard-conforming allocator, possibly with non-equal instances and
+ *  non-static members.  (It still behaves correctly even if _Alloc has
+ *  static member and if all instances are equal.  Refinements affect
+ *  performance, not correctness.)
+ *
+ *  There are always two members:  allocator_type, which is a standard-
+ *  conforming allocator type for allocating objects of type _Tp, and
+ *  _S_instanceless, a static const member of type bool.  If
+ *  _S_instanceless is true, this means that there is no difference
+ *  between any two instances of type allocator_type.  Furthermore, if
+ *  _S_instanceless is true, then _Alloc_traits has one additional
+ *  member:  _Alloc_type.  This type encapsulates allocation and
+ *  deallocation of objects of type _Tp through a static interface; it
+ *  has two member functions, whose signatures are
+ *
+ *  -  static _Tp* allocate(size_t)
+ *  -  static void deallocate(_Tp*, size_t)
+ *
+ *  The size_t parameters are "standard" style (see top of stl_alloc.h) in
+ *  that they take counts, not sizes.
+ *
+ *  (See @link Allocators allocators info @endlink for more.)
+ *  @endmaint
+*/
 // The fully general version.
-
 template <class _Tp, class _Allocator>
 struct _Alloc_traits
 {
@@ -807,18 +836,17 @@ struct _Alloc_traits
 template <class _Tp, class _Allocator>
 const bool _Alloc_traits<_Tp, _Allocator>::_S_instanceless;
 
-// The version for the default allocator.
-
+/// The version for the default allocator.
 template <class _Tp, class _Tp1>
 struct _Alloc_traits<_Tp, allocator<_Tp1> >
 {
   static const bool _S_instanceless = true;
-  typedef __simple_alloc<_Tp, alloc> _Alloc_type;
+  typedef __simple_alloc<_Tp, __alloc> _Alloc_type;
   typedef allocator<_Tp> allocator_type;
 };
 
-// Versions for the predefined SGI-style allocators.
-
+//@{
+/// Versions for the predefined "SGI" style allocators.
 template <class _Tp, int __inst>
 struct _Alloc_traits<_Tp, __malloc_alloc_template<__inst> >
 {
@@ -846,10 +874,10 @@ struct _Alloc_traits<_Tp, __debug_alloc<_Alloc> >
   typedef __simple_alloc<_Tp, __debug_alloc<_Alloc> > _Alloc_type;
   typedef __allocator<_Tp, __debug_alloc<_Alloc> > allocator_type;
 };
+//@}
 
-// Versions for the __allocator adaptor used with the predefined
-// SGI-style allocators.
-
+//@{
+/// Versions for the __allocator adaptor used with the predefined "SGI" style allocators.
 template <class _Tp, class _Tp1, int __inst>
 struct _Alloc_traits<_Tp, 
                      __allocator<_Tp1, __malloc_alloc_template<__inst> > >
@@ -880,10 +908,11 @@ struct _Alloc_traits<_Tp, __allocator<_Tp1, __debug_alloc<_Alloc> > >
   typedef __simple_alloc<_Tp, __debug_alloc<_Alloc> > _Alloc_type;
   typedef __allocator<_Tp, __debug_alloc<_Alloc> > allocator_type;
 };
+//@}
 
 } // namespace std
 
-#endif /* __SGI_STL_INTERNAL_ALLOC_H */
+#endif /* __GLIBCPP_INTERNAL_ALLOC_H */
 
 // Local Variables:
 // mode:C++
index fddf02ad8e73a1438731380d201c8ddb24eeef13..605831fdf97d881577c40f9e7bc634caed0ac519 100644 (file)
@@ -58,8 +58,8 @@
  *  You should not attempt to use it directly.
  */
 
-#ifndef __SGI_STL_INTERNAL_BVECTOR_H
-#define __SGI_STL_INTERNAL_BVECTOR_H
+#ifndef __GLIBCPP_INTERNAL_BVECTOR_H
+#define __GLIBCPP_INTERNAL_BVECTOR_H
 
 namespace std
 { 
@@ -717,11 +717,11 @@ template <typename _Alloc>
   };
 
 // This typedef is non-standard.  It is provided for backward compatibility.
-typedef vector<bool, alloc> bit_vector;
+typedef vector<bool, __alloc> bit_vector;
 
 } // namespace std 
 
-#endif /* __SGI_STL_INTERNAL_BVECTOR_H */
+#endif /* __GLIBCPP_INTERNAL_BVECTOR_H */
 
 // Local Variables:
 // mode:C++
index b837ed74bd34d928fad361fa7fd4c3cd5592fa25..6b0bae3f630d34f6a7bf8568f58cc8c0051d36b2 100644 (file)
@@ -62,8 +62,8 @@
 #include <bits/stl_iterator_base_types.h>
 #include <bits/stl_iterator_base_funcs.h>
 
-#ifndef __SGI_STL_INTERNAL_DEQUE_H
-#define __SGI_STL_INTERNAL_DEQUE_H
+#ifndef __GLIBCPP_INTERNAL_DEQUE_H
+#define __GLIBCPP_INTERNAL_DEQUE_H
 
 /* Class invariants:
  *  For any nonsingular iterator i:
@@ -1447,7 +1447,7 @@ inline void swap(deque<_Tp,_Alloc>& __x, deque<_Tp,_Alloc>& __y) {
 
 } // namespace std 
   
-#endif /* __SGI_STL_INTERNAL_DEQUE_H */
+#endif /* __GLIBCPP_INTERNAL_DEQUE_H */
 
 // Local Variables:
 // mode:C++
index 9fbead498dbfce26de93eb0952e9bcfb47fece60..d2a536856301ca165866d3737b2bdc19d795ab9c 100644 (file)
@@ -58,8 +58,8 @@
  *  You should not attempt to use it directly.
  */
 
-#ifndef __SGI_STL_INTERNAL_FUNCTION_H
-#define __SGI_STL_INTERNAL_FUNCTION_H
+#ifndef __GLIBCPP_INTERNAL_FUNCTION_H
+#define __GLIBCPP_INTERNAL_FUNCTION_H
 
 namespace std
 {
@@ -1046,7 +1046,7 @@ mem_fun1_ref(_Ret (_Tp::*__f)(_Arg) const)
 
 } // namespace std
 
-#endif /* __SGI_STL_INTERNAL_FUNCTION_H */
+#endif /* __GLIBCPP_INTERNAL_FUNCTION_H */
 
 // Local Variables:
 // mode:C++
index abf5e520c3fed0d44d3e7f9a7302dce04a45a817..ae7aafadca38a23211a95b078aa0ee760cf987d1 100644 (file)
@@ -58,8 +58,8 @@
  *  You should not attempt to use it directly.
  */
 
-#ifndef __SGI_STL_INTERNAL_ITERATOR_H
-#define __SGI_STL_INTERNAL_ITERATOR_H
+#ifndef __GLIBCPP_INTERNAL_ITERATOR_H
+#define __GLIBCPP_INTERNAL_ITERATOR_H
 
 namespace std
 {
index 1dda9c228ef6a791c1589ed35da04c71b1d5cb54..8f84977f118df0bcfb4bf9d6060b75e351bed54c 100644 (file)
@@ -58,8 +58,8 @@
  *  You should not attempt to use it directly.
  */
 
-#ifndef __SGI_STL_INTERNAL_ITERATOR_BASE_FUNCS_H
-#define __SGI_STL_INTERNAL_ITERATOR_BASE_FUNCS_H
+#ifndef __GLIBCPP_INTERNAL_ITERATOR_BASE_FUNCS_H
+#define __GLIBCPP_INTERNAL_ITERATOR_BASE_FUNCS_H
 
 // This file contains all of the general iterator-related utility
 // functions, such as distance() and advance().
@@ -176,7 +176,7 @@ namespace std
 
 } // namespace std
 
-#endif /* __SGI_STL_INTERNAL_ITERATOR_BASE_FUNCS_H */
+#endif /* __GLIBCPP_INTERNAL_ITERATOR_BASE_FUNCS_H */
 
 
 // Local Variables:
index 65aaa66f6cec34df194b1dbd8bdc737d3b325fcd..28f79c27a9002a25517f9e0c36b3a0e6272209c0 100644 (file)
@@ -58,8 +58,8 @@
  *  You should not attempt to use it directly.
  */
 
-#ifndef __SGI_STL_INTERNAL_ITERATOR_BASE_TYPES_H
-#define __SGI_STL_INTERNAL_ITERATOR_BASE_TYPES_H
+#ifndef __GLIBCPP_INTERNAL_ITERATOR_BASE_TYPES_H
+#define __GLIBCPP_INTERNAL_ITERATOR_BASE_TYPES_H
 
 // This file contains all of the general iterator-related utility
 // types, such as iterator_traits and struct iterator.
@@ -173,7 +173,7 @@ namespace std
 
 } // namespace std
 
-#endif /* __SGI_STL_INTERNAL_ITERATOR_BASE_TYPES_H */
+#endif /* __GLIBCPP_INTERNAL_ITERATOR_BASE_TYPES_H */
 
 
 // Local Variables:
index 3d787a0d5c060668b039d4cb078414a77f578bac..992057913874c2b98eedd4dd343c22bad4a00d15 100644 (file)
@@ -58,8 +58,8 @@
  *  You should not attempt to use it directly.
  */
 
-#ifndef __SGI_STL_INTERNAL_LIST_H
-#define __SGI_STL_INTERNAL_LIST_H
+#ifndef __GLIBCPP_INTERNAL_LIST_H
+#define __GLIBCPP_INTERNAL_LIST_H
 
 #include <bits/concept_check.h>
 
@@ -969,7 +969,7 @@ namespace std
 
 } // namespace std 
 
-#endif /* __SGI_STL_INTERNAL_LIST_H */
+#endif /* __GLIBCPP_INTERNAL_LIST_H */
 
 // vi:set ts=2 sw=2:
 // Local Variables:
index 65e264f257e7decf47a021ef2536ca96fd15f196..27b4d12faf0850c77e390a5261ef6f59a08b3e60 100644 (file)
@@ -58,8 +58,8 @@
  *  You should not attempt to use it directly.
  */
 
-#ifndef __SGI_STL_INTERNAL_MULTIMAP_H
-#define __SGI_STL_INTERNAL_MULTIMAP_H
+#ifndef __GLIBCPP_INTERNAL_MULTIMAP_H
+#define __GLIBCPP_INTERNAL_MULTIMAP_H
 
 #include <bits/concept_check.h>
 
@@ -258,7 +258,7 @@ inline void swap(multimap<_Key,_Tp,_Compare,_Alloc>& __x,
 
 } // namespace std
 
-#endif /* __SGI_STL_INTERNAL_MULTIMAP_H */
+#endif /* __GLIBCPP_INTERNAL_MULTIMAP_H */
 
 // Local Variables:
 // mode:C++
index 0ae57a6cb380e5a7b8a785518236e9cf265a3303..2bfc8f10c32b47c1cb82896336af5b67b90f6221 100644 (file)
@@ -58,8 +58,8 @@
  *  You should not attempt to use it directly.
  */
 
-#ifndef __SGI_STL_INTERNAL_MULTISET_H
-#define __SGI_STL_INTERNAL_MULTISET_H
+#ifndef __GLIBCPP_INTERNAL_MULTISET_H
+#define __GLIBCPP_INTERNAL_MULTISET_H
 
 #include <bits/concept_check.h>
 
@@ -270,7 +270,7 @@ inline void swap(multiset<_Key,_Compare,_Alloc>& __x,
 
 } // namespace std
 
-#endif /* __SGI_STL_INTERNAL_MULTISET_H */
+#endif /* __GLIBCPP_INTERNAL_MULTISET_H */
 
 // Local Variables:
 // mode:C++
index 10cc2e32258647bf870a5174fd40840b12d4203e..d689ccc8d27d63af737739f864b37c095f95ef57 100644 (file)
@@ -58,8 +58,8 @@
  *  You should not attempt to use it directly.
  */
 
-#ifndef __SGI_STL_INTERNAL_PAIR_H
-#define __SGI_STL_INTERNAL_PAIR_H
+#ifndef __GLIBCPP_INTERNAL_PAIR_H
+#define __GLIBCPP_INTERNAL_PAIR_H
 
 namespace std
 {
@@ -150,7 +150,7 @@ inline pair<_T1, _T2> make_pair(const _T1& __x, const _T2& __y)
 
 } // namespace std
 
-#endif /* __SGI_STL_INTERNAL_PAIR_H */
+#endif /* __GLIBCPP_INTERNAL_PAIR_H */
 
 // Local Variables:
 // mode:C++
index 82e6e5972feffb065e03e643f0e4192ae67b4953..5503640187aca1ba2c6b898c50379a4398896fd4 100644 (file)
@@ -58,8 +58,8 @@
  *  You should not attempt to use it directly.
  */
 
-#ifndef __SGI_STL_INTERNAL_QUEUE_H
-#define __SGI_STL_INTERNAL_QUEUE_H
+#ifndef __GLIBCPP_INTERNAL_QUEUE_H
+#define __GLIBCPP_INTERNAL_QUEUE_H
 
 #include <bits/concept_check.h>
 
@@ -237,7 +237,7 @@ public:
 
 } // namespace std
 
-#endif /* __SGI_STL_INTERNAL_QUEUE_H */
+#endif /* __GLIBCPP_INTERNAL_QUEUE_H */
 
 // Local Variables:
 // mode:C++
index 22dcef308a4b2c6f7a9d5734ebb48bdf19b08865..ee708c292179a07fd884cf340a01a4f689cf8a3c 100644 (file)
@@ -58,8 +58,8 @@
  *  You should not attempt to use it directly.
  */
 
-#ifndef __SGI_STL_INTERNAL_SET_H
-#define __SGI_STL_INTERNAL_SET_H
+#ifndef __GLIBCPP_INTERNAL_SET_H
+#define __GLIBCPP_INTERNAL_SET_H
 
 #include <bits/concept_check.h>
 
@@ -267,7 +267,7 @@ inline void swap(set<_Key,_Compare,_Alloc>& __x,
 
 } // namespace std
 
-#endif /* __SGI_STL_INTERNAL_SET_H */
+#endif /* __GLIBCPP_INTERNAL_SET_H */
 
 // Local Variables:
 // mode:C++
index 0352ec5368d1c070a29bd7e505219c1b4a0466e0..0a80b109f6a8ca48c7925415b2228faaf6f9259a 100644 (file)
@@ -58,8 +58,8 @@
  *  You should not attempt to use it directly.
  */
 
-#ifndef __SGI_STL_INTERNAL_STACK_H
-#define __SGI_STL_INTERNAL_STACK_H
+#ifndef __GLIBCPP_INTERNAL_STACK_H
+#define __GLIBCPP_INTERNAL_STACK_H
 
 #include <bits/concept_check.h>
 
@@ -153,7 +153,7 @@ bool operator>=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
 
 } // namespace std
 
-#endif /* __SGI_STL_INTERNAL_STACK_H */
+#endif /* __GLIBCPP_INTERNAL_STACK_H */
 
 // Local Variables:
 // mode:C++
index cbae35a43b3210e6b9d40da8e22485a5ed193b4b..9d64c0333a80a90e9e5dbc600772fc616e31dfa6 100644 (file)
@@ -58,8 +58,8 @@
  *  You should not attempt to use it directly.
  */
 
-#ifndef __SGI_STL_INTERNAL_TEMPBUF_H
-#define __SGI_STL_INTERNAL_TEMPBUF_H
+#ifndef __GLIBCPP_INTERNAL_TEMPBUF_H
+#define __GLIBCPP_INTERNAL_TEMPBUF_H
 
 namespace std
 {
@@ -181,7 +181,7 @@ struct temporary_buffer : public _Temporary_buffer<_ForwardIterator, _Tp>
     
 } // namespace std
 
-#endif /* __SGI_STL_INTERNAL_TEMPBUF_H */
+#endif /* __GLIBCPP_INTERNAL_TEMPBUF_H */
 
 // Local Variables:
 // mode:C++
index b0a052e442aade6ea408d7052276fa37603988b6..10734a0b9106aa2461a4aeb5d5bd13d19be8bcd6 100644 (file)
@@ -60,8 +60,8 @@
  *  You should not attempt to use it directly.
  */
 
-#ifndef __SGI_STL_INTERNAL_TREE_H
-#define __SGI_STL_INTERNAL_TREE_H
+#ifndef __GLIBCPP_INTERNAL_TREE_H
+#define __GLIBCPP_INTERNAL_TREE_H
 
 /*
 
@@ -1309,7 +1309,7 @@ struct rb_tree : public _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc>
 
 } // namespace std 
 
-#endif /* __SGI_STL_INTERNAL_TREE_H */
+#endif /* __GLIBCPP_INTERNAL_TREE_H */
 
 // Local Variables:
 // mode:C++
index 157d31f1dd49de886822dfc894d49450d9a184f8..39993b98d669143f7f2a521498ba112a81e00a36 100644 (file)
@@ -58,8 +58,8 @@
  *  You should not attempt to use it directly.
  */
 
-#ifndef __SGI_STL_INTERNAL_VECTOR_H
-#define __SGI_STL_INTERNAL_VECTOR_H
+#ifndef __GLIBCPP_INTERNAL_VECTOR_H
+#define __GLIBCPP_INTERNAL_VECTOR_H
 
 #include <bits/stl_iterator_base_funcs.h>
 #include <bits/functexcept.h>
@@ -802,7 +802,7 @@ vector<_Tp, _Alloc>::_M_range_insert(iterator __position,
 
 } // namespace std 
 
-#endif /* __SGI_STL_INTERNAL_VECTOR_H */
+#endif /* __GLIBCPP_INTERNAL_VECTOR_H */
 
 // Local Variables:
 // mode:C++
index 4d15517845fa165bc01f28931edc29b1aa0ca305..49e537b7b77c1b4d35150a67035d14d181d024fa 100644 (file)
@@ -863,15 +863,15 @@ bool rope<_CharT, _Alloc>::_S_apply_to_pieces(
                size_t __len = __end - __begin;
                bool __result;
                _CharT* __buffer =
-                 (_CharT*)alloc::allocate(__len * sizeof(_CharT));
+                 (_CharT*)__alloc::allocate(__len * sizeof(_CharT));
                try {
                  (*(__f->_M_fn))(__begin, __len, __buffer);
                  __result = __c(__buffer, __len);
-                  alloc::deallocate(__buffer, __len * sizeof(_CharT));
+                  __alloc::deallocate(__buffer, __len * sizeof(_CharT));
                 }
                catch(...)
                  {
-                   alloc::deallocate(__buffer, __len * sizeof(_CharT));
+                   __alloc::deallocate(__buffer, __len * sizeof(_CharT));
                    __throw_exception_again;
                  }
                return __result;
index 1425bac776f5ad3ba74bd83208bdfa9a18586d81..150775feae8701a77cf8ee90eb23e0d3ea8c3f66 100644 (file)
@@ -85,7 +85,7 @@ struct _Hashtable_node
 };  
 
 template <class _Val, class _Key, class _HashFcn,
-          class _ExtractKey, class _EqualKey, class _Alloc = alloc>
+          class _ExtractKey, class _EqualKey, class _Alloc = __alloc>
 class hashtable;
 
 template <class _Val, class _Key, class _HashFcn,