This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA libstdc++] More stl_alloc.h changes, general cleanup.


Bootstrapped on i686/linux and powerpc-sim, no regressions.

This is the last round of my changes which preserve current allocator
semantics.  Everything else I have in mind involves more serious changes.
Here we just do some more uglification, doxygenating, and simplification.

Also I noticed that we still had SGI's name in the include guards.  Fixed.

Ok to apply?


2001-12-03  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.


Index: include/backward/alloc.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/backward/alloc.h,v
retrieving revision 1.10
diff -u -3 -p -r1.10 alloc.h
--- include/backward/alloc.h	24 Nov 2001 03:28:27 -0000	1.10
+++ include/backward/alloc.h	3 Dec 2001 23:17:46 -0000
@@ -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: include/bits/std_bitset.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/std_bitset.h,v
retrieving revision 1.14
diff -u -3 -p -r1.14 std_bitset.h
--- include/bits/std_bitset.h	2 Nov 2001 17:38:10 -0000	1.14
+++ include/bits/std_bitset.h	3 Dec 2001 23:19:37 -0000
@@ -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
 
 #undef __BITSET_WORDS
 
-#endif /* __SGI_STL_BITSET */
+#endif /* __GLIBCPP_BITSET */
 
 
 // Local Variables:
Index: include/bits/stl_algo.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/stl_algo.h,v
retrieving revision 1.14
diff -u -3 -p -r1.14 stl_algo.h
--- include/bits/stl_algo.h	2 Nov 2001 17:38:11 -0000	1.14
+++ include/bits/stl_algo.h	3 Dec 2001 23:19:37 -0000
@@ -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: include/bits/stl_algobase.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/stl_algobase.h,v
retrieving revision 1.16
diff -u -3 -p -r1.16 stl_algobase.h
--- include/bits/stl_algobase.h	20 Nov 2001 00:51:37 -0000	1.16
+++ include/bits/stl_algobase.h	3 Dec 2001 23:19:37 -0000
@@ -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: include/bits/stl_alloc.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/stl_alloc.h,v
retrieving revision 1.12
diff -u -3 -p -r1.12 stl_alloc.h
--- include/bits/stl_alloc.h	3 Dec 2001 19:11:00 -0000	1.12
+++ include/bits/stl_alloc.h	3 Dec 2001 23:00:10 -0000
@@ -45,27 +45,36 @@
  *  You should not attempt to use it directly.
  */
 
-#ifndef __SGI_STL_INTERNAL_ALLOC_H
-#define __SGI_STL_INTERNAL_ALLOC_H
+#ifndef __GLIBCPP_INTERNAL_ALLOC_H
+#define __GLIBCPP_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).
+/**
+ *  @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_al
  *  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, __in
 	      }
 	    _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>:
 }
 
 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<__thread
 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, 
  *    - __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<_
 
 
 /**
- *  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
 }
 
 
-// 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_all
                        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<
   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<_T
   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: include/bits/stl_bvector.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/stl_bvector.h,v
retrieving revision 1.7
diff -u -3 -p -r1.7 stl_bvector.h
--- include/bits/stl_bvector.h	2 Nov 2001 17:38:11 -0000	1.7
+++ include/bits/stl_bvector.h	3 Dec 2001 23:19:37 -0000
@@ -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: include/bits/stl_deque.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/stl_deque.h,v
retrieving revision 1.14
diff -u -3 -p -r1.14 stl_deque.h
--- include/bits/stl_deque.h	16 Nov 2001 21:00:59 -0000	1.14
+++ include/bits/stl_deque.h	3 Dec 2001 23:19:37 -0000
@@ -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,
 
 } // namespace std 
   
-#endif /* __SGI_STL_INTERNAL_DEQUE_H */
+#endif /* __GLIBCPP_INTERNAL_DEQUE_H */
 
 // Local Variables:
 // mode:C++
Index: include/bits/stl_function.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/stl_function.h,v
retrieving revision 1.8
diff -u -3 -p -r1.8 stl_function.h
--- include/bits/stl_function.h	2 Nov 2001 17:38:11 -0000	1.8
+++ include/bits/stl_function.h	3 Dec 2001 23:19:37 -0000
@@ -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) cons
 
 } // namespace std
 
-#endif /* __SGI_STL_INTERNAL_FUNCTION_H */
+#endif /* __GLIBCPP_INTERNAL_FUNCTION_H */
 
 // Local Variables:
 // mode:C++
Index: include/bits/stl_iterator.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/stl_iterator.h,v
retrieving revision 1.15
diff -u -3 -p -r1.15 stl_iterator.h
--- include/bits/stl_iterator.h	2 Nov 2001 17:38:11 -0000	1.15
+++ include/bits/stl_iterator.h	3 Dec 2001 23:19:37 -0000
@@ -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: include/bits/stl_iterator_base_funcs.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/stl_iterator_base_funcs.h,v
retrieving revision 1.10
diff -u -3 -p -r1.10 stl_iterator_base_funcs.h
--- include/bits/stl_iterator_base_funcs.h	2 Nov 2001 17:38:11 -0000	1.10
+++ include/bits/stl_iterator_base_funcs.h	3 Dec 2001 23:19:37 -0000
@@ -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: include/bits/stl_iterator_base_types.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/stl_iterator_base_types.h,v
retrieving revision 1.7
diff -u -3 -p -r1.7 stl_iterator_base_types.h
--- include/bits/stl_iterator_base_types.h	2 Nov 2001 17:38:11 -0000	1.7
+++ include/bits/stl_iterator_base_types.h	3 Dec 2001 23:19:37 -0000
@@ -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: include/bits/stl_list.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/stl_list.h,v
retrieving revision 1.11
diff -u -3 -p -r1.11 stl_list.h
--- include/bits/stl_list.h	22 Nov 2001 19:19:23 -0000	1.11
+++ include/bits/stl_list.h	3 Dec 2001 23:19:37 -0000
@@ -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: include/bits/stl_multimap.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/stl_multimap.h,v
retrieving revision 1.9
diff -u -3 -p -r1.9 stl_multimap.h
--- include/bits/stl_multimap.h	2 Nov 2001 17:38:11 -0000	1.9
+++ include/bits/stl_multimap.h	3 Dec 2001 23:19:37 -0000
@@ -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,_Comp
 
 } // namespace std
 
-#endif /* __SGI_STL_INTERNAL_MULTIMAP_H */
+#endif /* __GLIBCPP_INTERNAL_MULTIMAP_H */
 
 // Local Variables:
 // mode:C++
Index: include/bits/stl_multiset.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/stl_multiset.h,v
retrieving revision 1.10
diff -u -3 -p -r1.10 stl_multiset.h
--- include/bits/stl_multiset.h	2 Nov 2001 17:38:11 -0000	1.10
+++ include/bits/stl_multiset.h	3 Dec 2001 23:19:37 -0000
@@ -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,
 
 } // namespace std
 
-#endif /* __SGI_STL_INTERNAL_MULTISET_H */
+#endif /* __GLIBCPP_INTERNAL_MULTISET_H */
 
 // Local Variables:
 // mode:C++
Index: include/bits/stl_pair.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/stl_pair.h,v
retrieving revision 1.10
diff -u -3 -p -r1.10 stl_pair.h
--- include/bits/stl_pair.h	2 Nov 2001 17:38:11 -0000	1.10
+++ include/bits/stl_pair.h	3 Dec 2001 23:19:37 -0000
@@ -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 _T
 
 } // namespace std
 
-#endif /* __SGI_STL_INTERNAL_PAIR_H */
+#endif /* __GLIBCPP_INTERNAL_PAIR_H */
 
 // Local Variables:
 // mode:C++
Index: include/bits/stl_queue.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/stl_queue.h,v
retrieving revision 1.11
diff -u -3 -p -r1.11 stl_queue.h
--- include/bits/stl_queue.h	2 Nov 2001 17:38:11 -0000	1.11
+++ include/bits/stl_queue.h	3 Dec 2001 23:19:37 -0000
@@ -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: include/bits/stl_set.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/stl_set.h,v
retrieving revision 1.10
diff -u -3 -p -r1.10 stl_set.h
--- include/bits/stl_set.h	2 Nov 2001 17:38:11 -0000	1.10
+++ include/bits/stl_set.h	3 Dec 2001 23:19:37 -0000
@@ -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,_Allo
 
 } // namespace std
 
-#endif /* __SGI_STL_INTERNAL_SET_H */
+#endif /* __GLIBCPP_INTERNAL_SET_H */
 
 // Local Variables:
 // mode:C++
Index: include/bits/stl_stack.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/stl_stack.h,v
retrieving revision 1.9
diff -u -3 -p -r1.9 stl_stack.h
--- include/bits/stl_stack.h	2 Nov 2001 17:38:11 -0000	1.9
+++ include/bits/stl_stack.h	3 Dec 2001 23:19:37 -0000
@@ -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>& _
 
 } // namespace std
 
-#endif /* __SGI_STL_INTERNAL_STACK_H */
+#endif /* __GLIBCPP_INTERNAL_STACK_H */
 
 // Local Variables:
 // mode:C++
Index: include/bits/stl_tempbuf.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/stl_tempbuf.h,v
retrieving revision 1.8
diff -u -3 -p -r1.8 stl_tempbuf.h
--- include/bits/stl_tempbuf.h	2 Nov 2001 17:38:11 -0000	1.8
+++ include/bits/stl_tempbuf.h	3 Dec 2001 23:19:37 -0000
@@ -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 _Tempor
     
 } // namespace std
 
-#endif /* __SGI_STL_INTERNAL_TEMPBUF_H */
+#endif /* __GLIBCPP_INTERNAL_TEMPBUF_H */
 
 // Local Variables:
 // mode:C++
Index: include/bits/stl_tree.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/stl_tree.h,v
retrieving revision 1.10
diff -u -3 -p -r1.10 stl_tree.h
--- include/bits/stl_tree.h	2 Nov 2001 17:38:11 -0000	1.10
+++ include/bits/stl_tree.h	3 Dec 2001 23:19:37 -0000
@@ -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, _
 
 } // namespace std 
 
-#endif /* __SGI_STL_INTERNAL_TREE_H */
+#endif /* __GLIBCPP_INTERNAL_TREE_H */
 
 // Local Variables:
 // mode:C++
Index: include/bits/stl_vector.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/stl_vector.h,v
retrieving revision 1.13
diff -u -3 -p -r1.13 stl_vector.h
--- include/bits/stl_vector.h	2 Nov 2001 17:38:11 -0000	1.13
+++ include/bits/stl_vector.h	3 Dec 2001 23:19:37 -0000
@@ -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(ite
 
 } // namespace std 
 
-#endif /* __SGI_STL_INTERNAL_VECTOR_H */
+#endif /* __GLIBCPP_INTERNAL_VECTOR_H */
 
 // Local Variables:
 // mode:C++
Index: include/ext/ropeimpl.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/ext/ropeimpl.h,v
retrieving revision 1.9
diff -u -3 -p -r1.9 ropeimpl.h
--- include/ext/ropeimpl.h	23 Nov 2001 16:29:01 -0000	1.9
+++ include/ext/ropeimpl.h	3 Dec 2001 23:17:14 -0000
@@ -863,15 +863,15 @@ bool rope<_CharT, _Alloc>::_S_apply_to_p
 		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: include/ext/stl_hashtable.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/ext/stl_hashtable.h,v
retrieving revision 1.10
diff -u -3 -p -r1.10 stl_hashtable.h
--- include/ext/stl_hashtable.h	20 Nov 2001 00:51:37 -0000	1.10
+++ include/ext/stl_hashtable.h	3 Dec 2001 23:17:14 -0000
@@ -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,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]