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]

[v3] Use Alloc::ppinter in std::vector


Hi,

I'm committing immediately to mainline the uncontroversial changes to
std::vector suggested by Bob as part of his work on "extended pointers"
support. Tested x86_64-linux.

Paolo.

///////////////////////
2008-10-08  Bob Walters  <bob.s.walters@gmail.com>

	* include/bits/stl_vector.h (_Vector_base<>::_Vector_impl::_M_start,
	_M_finish, _M_end_of_storage, _Vector_base<>::_M_allocate,
	_M_deallocate): Use _Tp_alloc_type::pointer.
Index: include/bits/stl_vector.h
===================================================================
*** include/bits/stl_vector.h	(revision 140943)
--- include/bits/stl_vector.h	(working copy)
*************** _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL
*** 78,86 ****
        struct _Vector_impl 
        : public _Tp_alloc_type
        {
! 	_Tp*           _M_start;
! 	_Tp*           _M_finish;
! 	_Tp*           _M_end_of_storage;
  
  	_Vector_impl()
  	: _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)
--- 78,86 ----
        struct _Vector_impl 
        : public _Tp_alloc_type
        {
! 	typename _Tp_alloc_type::pointer _M_start;
! 	typename _Tp_alloc_type::pointer _M_finish;
! 	typename _Tp_alloc_type::pointer _M_end_of_storage;
  
  	_Vector_impl()
  	: _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)
*************** _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL
*** 140,151 ****
      public:
        _Vector_impl _M_impl;
  
!       _Tp*
        _M_allocate(size_t __n)
        { return __n != 0 ? _M_impl.allocate(__n) : 0; }
  
        void
!       _M_deallocate(_Tp* __p, size_t __n)
        {
  	if (__p)
  	  _M_impl.deallocate(__p, __n);
--- 140,151 ----
      public:
        _Vector_impl _M_impl;
  
!       typename _Tp_alloc_type::pointer
        _M_allocate(size_t __n)
        { return __n != 0 ? _M_impl.allocate(__n) : 0; }
  
        void
!       _M_deallocate(typename _Tp_alloc_type::pointer __p, size_t __n)
        {
  	if (__p)
  	  _M_impl.deallocate(__p, __n);

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