From: François Dumont Date: Thu, 21 Jul 2011 19:56:36 +0000 (+0000) Subject: safe_unordered_sequence.h, [...]: Rename respectively in... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=364c862b4db320f88558443023bafa7fe1bb74ff;p=gcc.git safe_unordered_sequence.h, [...]: Rename respectively in... 2011-07-21 François Dumont * include/debug/safe_unordered_sequence.h, safe_unordered_sequence.tcc: Rename respectively in... * include/debug/safe_unordered_container.h, safe_unordered_container.tcc: ...those. _Safe_unordered_sequence rename _Safe_unordered_container. * include/debug/safe_unordered_base.h: _Safe_unordered_sequence_base rename _Safe_unordered_container_base. * include/debug/unordered_map, unordered_set: Adapt to previous modifications. * config/abi/pre/gnu.ver: Likewise. * src/debug.cc: Likewise. * include/Makefile.am: Likewise. * include/Makefile.in: Regenerate. From-SVN: r176584 --- diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver index 3d797a8aa17..bd392456950 100644 --- a/libstdc++-v3/config/abi/pre/gnu.ver +++ b/libstdc++-v3/config/abi/pre/gnu.ver @@ -1284,9 +1284,9 @@ GLIBCXX_3.4.17 { # std::thread::hardware_concurrency _ZNSt6thread20hardware_concurrencyEv; - # __gnu_debug::_Safe_unordered_sequence_base and _Safe_local_iterator_base - _ZN11__gnu_debug29_Safe_unordered_sequence_base7_M_swapERS0_; - _ZN11__gnu_debug29_Safe_unordered_sequence_base13_M_detach_allEv; + # __gnu_debug::_Safe_unordered_container_base and _Safe_local_iterator_base + _ZN11__gnu_debug30_Safe_unordered_container_base7_M_swapERS0_; + _ZN11__gnu_debug30_Safe_unordered_container_base13_M_detach_allEv; _ZN11__gnu_debug25_Safe_local_iterator_base9_M_attachEPNS_19_Safe_sequence_baseEb; _ZN11__gnu_debug25_Safe_local_iterator_base9_M_detachEv; diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index 52e94cc0c42..401688247f0 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -706,8 +706,8 @@ debug_headers = \ ${debug_srcdir}/safe_sequence.h \ ${debug_srcdir}/safe_sequence.tcc \ ${debug_srcdir}/safe_unordered_base.h \ - ${debug_srcdir}/safe_unordered_sequence.h \ - ${debug_srcdir}/safe_unordered_sequence.tcc \ + ${debug_srcdir}/safe_unordered_container.h \ + ${debug_srcdir}/safe_unordered_container.tcc \ ${debug_srcdir}/set \ ${debug_srcdir}/set.h \ ${debug_srcdir}/string \ diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 76d4123da96..65da567cf07 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -951,8 +951,8 @@ debug_headers = \ ${debug_srcdir}/safe_sequence.h \ ${debug_srcdir}/safe_sequence.tcc \ ${debug_srcdir}/safe_unordered_base.h \ - ${debug_srcdir}/safe_unordered_sequence.h \ - ${debug_srcdir}/safe_unordered_sequence.tcc \ + ${debug_srcdir}/safe_unordered_container.h \ + ${debug_srcdir}/safe_unordered_container.tcc \ ${debug_srcdir}/set \ ${debug_srcdir}/set.h \ ${debug_srcdir}/string \ diff --git a/libstdc++-v3/include/debug/safe_unordered_base.h b/libstdc++-v3/include/debug/safe_unordered_base.h index 14d83bc49fb..9d1131df40e 100644 --- a/libstdc++-v3/include/debug/safe_unordered_base.h +++ b/libstdc++-v3/include/debug/safe_unordered_base.h @@ -1,4 +1,4 @@ -// Safe sequence/iterator base implementation -*- C++ -*- +// Safe container/iterator base implementation -*- C++ -*- // Copyright (C) 2011 Free Software Foundation, Inc. // @@ -33,13 +33,13 @@ namespace __gnu_debug { - class _Safe_unordered_sequence_base; + class _Safe_unordered_container_base; /** \brief Basic functionality for a @a safe iterator. * * The %_Safe_local_iterator_base base class implements the functionality * of a safe local iterator that is not specific to a particular iterator - * type. It contains a pointer back to the sequence it references + * type. It contains a pointer back to the container it references * along with iterator version information and pointers to form a * doubly-linked list of local iterators referenced by the container. * @@ -54,7 +54,7 @@ namespace __gnu_debug _Safe_local_iterator_base() { } - /** Initialize the iterator to reference the sequence pointed to + /** Initialize the iterator to reference the container pointed to * by @p__seq. @p __constant is true when we are initializing a * constant local iterator, and false if it is a mutable local iterator. * Note that @p __seq may be NULL, in which case the iterator will be @@ -64,7 +64,7 @@ namespace __gnu_debug _Safe_local_iterator_base(const _Safe_sequence_base* __seq, bool __constant) { this->_M_attach(const_cast<_Safe_sequence_base*>(__seq), __constant); } - /** Initializes the iterator to reference the same sequence that + /** Initializes the iterator to reference the same container that @p __x does. @p __constant is true if this is a constant iterator, and false if it is mutable. */ _Safe_local_iterator_base(const _Safe_local_iterator_base& __x, @@ -79,13 +79,13 @@ namespace __gnu_debug ~_Safe_local_iterator_base() { this->_M_detach(); } - _Safe_unordered_sequence_base* - _M_get_sequence() const _GLIBCXX_NOEXCEPT; + _Safe_unordered_container_base* + _M_get_container() const _GLIBCXX_NOEXCEPT; public: - /** Attaches this iterator to the given sequence, detaching it - * from whatever sequence it was attached to originally. If the - * new sequence is the NULL pointer, the iterator is left + /** Attaches this iterator to the given container, detaching it + * from whatever container it was attached to originally. If the + * new container is the NULL pointer, the iterator is left * unattached. */ void _M_attach(_Safe_sequence_base* __seq, bool __constant); @@ -93,7 +93,7 @@ namespace __gnu_debug /** Likewise, but not thread-safe. */ void _M_attach_single(_Safe_sequence_base* __seq, bool __constant) throw (); - /** Detach the iterator for whatever sequence it is attached to, + /** Detach the iterator for whatever container it is attached to, * if any. */ void _M_detach(); @@ -104,23 +104,23 @@ namespace __gnu_debug /** * @brief Base class that supports tracking of local iterators that - * reference an unordered sequence. + * reference an unordered container. * - * The %_Safe_unordered_sequence_base class provides basic support for - * tracking iterators into an unordered sequence. Sequences that track - * iterators must derived from %_Safe_sequence_base publicly, so + * The %_Safe_unordered_container_base class provides basic support for + * tracking iterators into an unordered container. Containers that track + * iterators must derived from %_Safe_unordered_container_base publicly, so * that safe iterators (which inherit _Safe_iterator_base) can * attach to them. This class contains four linked lists of * iterators, one for constant iterators, one for mutable * iterators, one for constant local iterators, one for mutable local - * iterator and a version number that allows very fast + * iterators and a version number that allows very fast * invalidation of all iterators that reference the container. * * This class must ensure that no operation on it may throw an - * exception, otherwise @a safe sequences may fail to provide the + * exception, otherwise @a safe containers may fail to provide the * exception-safety guarantees required by the C++ standard. */ - class _Safe_unordered_sequence_base : public _Safe_sequence_base + class _Safe_unordered_container_base : public _Safe_sequence_base { typedef _Safe_sequence_base _Base; public: @@ -132,29 +132,29 @@ namespace __gnu_debug protected: // Initialize with a version number of 1 and no iterators - _Safe_unordered_sequence_base() + _Safe_unordered_container_base() : _M_local_iterators(0), _M_const_local_iterators(0) { } - /** Notify all iterators that reference this sequence that the - sequence is being destroyed. */ - ~_Safe_unordered_sequence_base() + /** Notify all iterators that reference this container that the + container is being destroyed. */ + ~_Safe_unordered_container_base() { this->_M_detach_all(); } /** Detach all iterators, leaving them singular. */ void _M_detach_all(); - /** Swap this sequence with the given sequence. This operation + /** Swap this container with the given container. This operation * also swaps ownership of the iterators, so that when the * operation is complete all iterators that originally referenced * one container now reference the other container. */ void - _M_swap(_Safe_unordered_sequence_base& __x); + _M_swap(_Safe_unordered_container_base& __x); public: - /** Attach an iterator to this sequence. */ + /** Attach an iterator to this container. */ void _M_attach_local(_Safe_iterator_base* __it, bool __constant); @@ -162,7 +162,7 @@ namespace __gnu_debug void _M_attach_local_single(_Safe_iterator_base* __it, bool __constant) throw (); - /** Detach an iterator from this sequence */ + /** Detach an iterator from this container */ void _M_detach_local(_Safe_iterator_base* __it); diff --git a/libstdc++-v3/include/debug/safe_unordered_container.h b/libstdc++-v3/include/debug/safe_unordered_container.h new file mode 100644 index 00000000000..ce15f9cfb49 --- /dev/null +++ b/libstdc++-v3/include/debug/safe_unordered_container.h @@ -0,0 +1,81 @@ +// Safe container implementation -*- C++ -*- + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file debug/safe_unordered_container.h + * This file is a GNU debug extension to the Standard C++ Library. + */ + +#ifndef _GLIBCXX_DEBUG_SAFE_UNORDERED_CONTAINER_H +#define _GLIBCXX_DEBUG_SAFE_UNORDERED_CONTAINER_H 1 + +#include +#include +#include +#include + +namespace __gnu_debug +{ + /** + * @brief Base class for constructing a @a safe unordered container type + * that tracks iterators that reference it. + * + * The class template %_Safe_unordered_container simplifies the + * construction of @a safe unordered containers that track the iterators + * that reference the container, so that the iterators are notified of + * changes in the container that may affect their operation, e.g., if + * the container invalidates its iterators or is destructed. This class + * template may only be used by deriving from it and passing the name + * of the derived class as its template parameter via the curiously + * recurring template pattern. The derived class must have @c + * iterator and @const_iterator types that are instantiations of + * class template _Safe_iterator for this container and @c local_iterator + * and @const_local_iterator types that are instantiations of class + * template _Safe_local_iterator for this container. Iterators will + * then be tracked automatically. + */ + template + class _Safe_unordered_container : public _Safe_unordered_container_base + { + public: + /** Invalidates all iterators @c x that reference this container, + are not singular, and for which @c pred(x) returns @c + true. @c pred will be invoked with the normal iterators nested + in the safe ones. */ + template + void + _M_invalidate_if(_Predicate __pred); + + /** Invalidates all local iterators @c x that reference this container, + are not singular, and for which @c pred(x) returns @c + true. @c pred will be invoked with the normal ilocal iterators + nested in the safe ones. */ + template + void + _M_invalidate_local_if(_Predicate __pred); + }; +} // namespace __gnu_debug + +#include + +#endif diff --git a/libstdc++-v3/include/debug/safe_unordered_container.tcc b/libstdc++-v3/include/debug/safe_unordered_container.tcc new file mode 100644 index 00000000000..69aafa8e819 --- /dev/null +++ b/libstdc++-v3/include/debug/safe_unordered_container.tcc @@ -0,0 +1,100 @@ +// Safe container implementation -*- C++ -*- + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file debug/safe_unordered_container.tcc + * This file is a GNU debug extension to the Standard C++ Library. + */ + +#ifndef _GLIBCXX_DEBUG_SAFE_UNORDERED_CONTAINER_TCC +#define _GLIBCXX_DEBUG_SAFE_UNORDERED_CONTAINER_TCC 1 + +namespace __gnu_debug +{ + template + template + void + _Safe_unordered_container<_Container>:: + _M_invalidate_if(_Predicate __pred) + { + typedef typename _Container::iterator iterator; + typedef typename _Container::const_iterator const_iterator; + + __gnu_cxx::__scoped_lock sentry(this->_M_get_mutex()); + for (_Safe_iterator_base* __iter = _M_iterators; __iter;) + { + iterator* __victim = static_cast(__iter); + __iter = __iter->_M_next; + if (!__victim->_M_singular() && __pred(__victim->base())) + { + __victim->_M_invalidate(); + } + } + + for (_Safe_iterator_base* __iter2 = _M_const_iterators; __iter2;) + { + const_iterator* __victim = static_cast(__iter2); + __iter2 = __iter2->_M_next; + if (!__victim->_M_singular() && __pred(__victim->base())) + { + __victim->_M_invalidate(); + } + } + } + + + template + template + void + _Safe_unordered_container<_Container>:: + _M_invalidate_local_if(_Predicate __pred) + { + typedef typename _Container::local_iterator local_iterator; + typedef typename _Container::const_local_iterator const_local_iterator; + + __gnu_cxx::__scoped_lock sentry(this->_M_get_mutex()); + for (_Safe_iterator_base* __iter = _M_local_iterators; __iter;) + { + local_iterator* __victim = static_cast(__iter); + __iter = __iter->_M_next; + if (!__victim->_M_singular() && __pred(__victim->base())) + { + __victim->_M_invalidate(); + } + } + + for (_Safe_iterator_base* __iter2 = _M_const_local_iterators; __iter2;) + { + const_local_iterator* __victim = + static_cast(__iter2); + __iter2 = __iter2->_M_next; + if (!__victim->_M_singular() && __pred(__victim->base())) + { + __victim->_M_invalidate(); + } + } + } + +} // namespace __gnu_debug + +#endif diff --git a/libstdc++-v3/include/debug/safe_unordered_sequence.h b/libstdc++-v3/include/debug/safe_unordered_sequence.h deleted file mode 100644 index f32b9113e6f..00000000000 --- a/libstdc++-v3/include/debug/safe_unordered_sequence.h +++ /dev/null @@ -1,75 +0,0 @@ -// Safe sequence implementation -*- C++ -*- - -// Copyright (C) 2011 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -/** @file debug/safe_unordered_sequence.h - * This file is a GNU debug extension to the Standard C++ Library. - */ - -#ifndef _GLIBCXX_DEBUG_SAFE_UNORDERED_SEQUENCE_H -#define _GLIBCXX_DEBUG_SAFE_UNORDERED_SEQUENCE_H 1 - -#include -#include -#include -#include - -namespace __gnu_debug -{ - /** - * @brief Base class for constructing a @a safe unordered sequence type - * that tracks iterators that reference it. - * - * The class template %_Safe_unordered_sequence simplifies the - * construction of @a safe unordered sequences that track the iterators - * that reference the sequence, so that the iterators are notified of - * changes in the sequence that may affect their operation, e.g., if - * the container invalidates its iterators or is destructed. This class - * template may only be used by deriving from it and passing the name - * of the derived class as its template parameter via the curiously - * recurring template pattern. The derived class must have @c - * iterator and @const_iterator types that are instantiations of - * class template _Safe_iterator for this sequence. Iterators will - * then be tracked automatically. - */ - template - class _Safe_unordered_sequence : public _Safe_unordered_sequence_base - { - public: - /** Invalidates all iterators @c x that reference this sequence, - are not singular, and for which @c pred(x) returns @c - true. @c pred will be invoked with the normal iterators nested - in the safe ones. */ - template - void - _M_invalidate_if(_Predicate __pred); - - template - void - _M_invalidate_local_if(_Predicate __pred); - }; -} // namespace __gnu_debug - -#include - -#endif diff --git a/libstdc++-v3/include/debug/safe_unordered_sequence.tcc b/libstdc++-v3/include/debug/safe_unordered_sequence.tcc deleted file mode 100644 index 88907e8839d..00000000000 --- a/libstdc++-v3/include/debug/safe_unordered_sequence.tcc +++ /dev/null @@ -1,100 +0,0 @@ -// Safe sequence implementation -*- C++ -*- - -// Copyright (C) 2011 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -/** @file debug/safe_unordered_sequence.tcc - * This file is a GNU debug extension to the Standard C++ Library. - */ - -#ifndef _GLIBCXX_DEBUG_SAFE_UNORDERED_SEQUENCE_TCC -#define _GLIBCXX_DEBUG_SAFE_UNORDERED_SEQUENCE_TCC 1 - -namespace __gnu_debug -{ - template - template - void - _Safe_unordered_sequence<_Sequence>:: - _M_invalidate_if(_Predicate __pred) - { - typedef typename _Sequence::iterator iterator; - typedef typename _Sequence::const_iterator const_iterator; - - __gnu_cxx::__scoped_lock sentry(this->_M_get_mutex()); - for (_Safe_iterator_base* __iter = _M_iterators; __iter;) - { - iterator* __victim = static_cast(__iter); - __iter = __iter->_M_next; - if (!__victim->_M_singular() && __pred(__victim->base())) - { - __victim->_M_invalidate(); - } - } - - for (_Safe_iterator_base* __iter2 = _M_const_iterators; __iter2;) - { - const_iterator* __victim = static_cast(__iter2); - __iter2 = __iter2->_M_next; - if (!__victim->_M_singular() && __pred(__victim->base())) - { - __victim->_M_invalidate(); - } - } - } - - - template - template - void - _Safe_unordered_sequence<_Sequence>:: - _M_invalidate_local_if(_Predicate __pred) - { - typedef typename _Sequence::local_iterator local_iterator; - typedef typename _Sequence::const_local_iterator const_local_iterator; - - __gnu_cxx::__scoped_lock sentry(this->_M_get_mutex()); - for (_Safe_iterator_base* __iter = _M_local_iterators; __iter;) - { - local_iterator* __victim = static_cast(__iter); - __iter = __iter->_M_next; - if (!__victim->_M_singular() && __pred(__victim->base())) - { - __victim->_M_invalidate(); - } - } - - for (_Safe_iterator_base* __iter2 = _M_const_local_iterators; __iter2;) - { - const_local_iterator* __victim = - static_cast(__iter2); - __iter2 = __iter2->_M_next; - if (!__victim->_M_singular() && __pred(__victim->base())) - { - __victim->_M_invalidate(); - } - } - } - -} // namespace __gnu_debug - -#endif diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map index 93ce517b1f7..0e300983bda 100644 --- a/libstdc++-v3/include/debug/unordered_map +++ b/libstdc++-v3/include/debug/unordered_map @@ -35,7 +35,7 @@ #else # include -#include +#include #include #include @@ -50,12 +50,12 @@ namespace __debug typename _Alloc = std::allocator<_Key> > class unordered_map : public _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>, - public __gnu_debug::_Safe_unordered_sequence > { typedef _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc> _Base; - typedef __gnu_debug::_Safe_unordered_sequence _Safe_base; + typedef __gnu_debug::_Safe_unordered_container _Safe_base; typedef typename _Base::const_iterator _Base_const_iterator; typedef typename _Base::iterator _Base_iterator; typedef typename _Base::const_local_iterator _Base_const_local_iterator; @@ -430,12 +430,12 @@ namespace __debug class unordered_multimap : public _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>, - public __gnu_debug::_Safe_unordered_sequence > { typedef _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc> _Base; - typedef __gnu_debug::_Safe_unordered_sequence + typedef __gnu_debug::_Safe_unordered_container _Safe_base; typedef typename _Base::const_iterator _Base_const_iterator; typedef typename _Base::iterator _Base_iterator; diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set index 981db4a83e6..5be37247584 100644 --- a/libstdc++-v3/include/debug/unordered_set +++ b/libstdc++-v3/include/debug/unordered_set @@ -35,7 +35,7 @@ #else # include -#include +#include #include #include @@ -50,12 +50,12 @@ namespace __debug typename _Alloc = std::allocator<_Value> > class unordered_set : public _GLIBCXX_STD_C::unordered_set<_Value, _Hash, _Pred, _Alloc>, - public __gnu_debug::_Safe_unordered_sequence > { typedef _GLIBCXX_STD_C::unordered_set<_Value, _Hash, _Pred, _Alloc> _Base; - typedef __gnu_debug::_Safe_unordered_sequence _Safe_base; + typedef __gnu_debug::_Safe_unordered_container _Safe_base; typedef typename _Base::const_iterator _Base_const_iterator; typedef typename _Base::iterator _Base_iterator; typedef typename _Base::const_local_iterator _Base_const_local_iterator; @@ -425,12 +425,12 @@ namespace __debug typename _Alloc = std::allocator<_Value> > class unordered_multiset : public _GLIBCXX_STD_C::unordered_multiset<_Value, _Hash, _Pred, _Alloc>, - public __gnu_debug::_Safe_unordered_sequence< + public __gnu_debug::_Safe_unordered_container< unordered_multiset<_Value, _Hash, _Pred, _Alloc> > { typedef _GLIBCXX_STD_C::unordered_multiset<_Value, _Hash, _Pred, _Alloc> _Base; - typedef __gnu_debug::_Safe_unordered_sequence + typedef __gnu_debug::_Safe_unordered_container _Safe_base; typedef typename _Base::const_iterator _Base_const_iterator; typedef typename _Base::iterator _Base_iterator; diff --git a/libstdc++-v3/src/debug.cc b/libstdc++-v3/src/debug.cc index 1144c697e0d..cb66f70b25f 100644 --- a/libstdc++-v3/src/debug.cc +++ b/libstdc++-v3/src/debug.cc @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include @@ -78,8 +78,8 @@ namespace } void - swap_useq(__gnu_debug::_Safe_unordered_sequence_base& __lhs, - __gnu_debug::_Safe_unordered_sequence_base& __rhs) + swap_ucont(__gnu_debug::_Safe_unordered_container_base& __lhs, + __gnu_debug::_Safe_unordered_container_base& __rhs) { swap_seq(__lhs, __rhs); swap_its(__lhs, __lhs._M_local_iterators, @@ -174,8 +174,8 @@ namespace __gnu_debug " by a dereferenceable one", "function requires a valid iterator range (%2.name;, %3.name;)" ", \"%2.name;\" shall be before and not equal to \"%3.name;\"", - // std::unordered_sequence::local_iterator - "attempt to compare local iterators from different unordered sequence" + // std::unordered_container::local_iterator + "attempt to compare local iterators from different unordered container" " buckets" }; @@ -374,38 +374,38 @@ namespace __gnu_debug _M_get_mutex() throw () { return get_safe_base_mutex(_M_sequence); } - _Safe_unordered_sequence_base* + _Safe_unordered_container_base* _Safe_local_iterator_base:: - _M_get_sequence() const _GLIBCXX_NOEXCEPT - { return static_cast<_Safe_unordered_sequence_base*>(_M_sequence); } + _M_get_container() const _GLIBCXX_NOEXCEPT + { return static_cast<_Safe_unordered_container_base*>(_M_sequence); } void _Safe_local_iterator_base:: - _M_attach(_Safe_sequence_base* __seq, bool __constant) + _M_attach(_Safe_sequence_base* __cont, bool __constant) { _M_detach(); - // Attach to the new sequence (if there is one) - if (__seq) + // Attach to the new container (if there is one) + if (__cont) { - _M_sequence = __seq; + _M_sequence = __cont; _M_version = _M_sequence->_M_version; - _M_get_sequence()->_M_attach_local(this, __constant); + _M_get_container()->_M_attach_local(this, __constant); } } void _Safe_local_iterator_base:: - _M_attach_single(_Safe_sequence_base* __seq, bool __constant) throw () + _M_attach_single(_Safe_sequence_base* __cont, bool __constant) throw () { _M_detach_single(); - // Attach to the new sequence (if there is one) - if (__seq) + // Attach to the new container (if there is one) + if (__cont) { - _M_sequence = __seq; + _M_sequence = __cont; _M_version = _M_sequence->_M_version; - _M_get_sequence()->_M_attach_local_single(this, __constant); + _M_get_container()->_M_attach_local_single(this, __constant); } } @@ -414,7 +414,7 @@ namespace __gnu_debug _M_detach() { if (_M_sequence) - _M_get_sequence()->_M_detach_local(this); + _M_get_container()->_M_detach_local(this); _M_reset(); } @@ -424,13 +424,13 @@ namespace __gnu_debug _M_detach_single() throw () { if (_M_sequence) - _M_get_sequence()->_M_detach_local_single(this); + _M_get_container()->_M_detach_local_single(this); _M_reset(); } void - _Safe_unordered_sequence_base:: + _Safe_unordered_container_base:: _M_detach_all() { __gnu_cxx::__scoped_lock sentry(_M_get_mutex()); @@ -448,17 +448,17 @@ namespace __gnu_debug } void - _Safe_unordered_sequence_base:: - _M_swap(_Safe_unordered_sequence_base& __x) + _Safe_unordered_container_base:: + _M_swap(_Safe_unordered_container_base& __x) { - // We need to lock both sequences to swap + // We need to lock both containers to swap using namespace __gnu_cxx; __mutex *__this_mutex = &_M_get_mutex(); __mutex *__x_mutex = &__x._M_get_mutex(); if (__this_mutex == __x_mutex) { __scoped_lock __lock(*__this_mutex); - swap_useq(*this, __x); + swap_ucont(*this, __x); } else { @@ -466,12 +466,12 @@ namespace __gnu_debug ? *__this_mutex : *__x_mutex); __scoped_lock __l2(__this_mutex < __x_mutex ? *__x_mutex : *__this_mutex); - swap_useq(*this, __x); + swap_ucont(*this, __x); } } void - _Safe_unordered_sequence_base:: + _Safe_unordered_container_base:: _M_attach_local(_Safe_iterator_base* __it, bool __constant) { __gnu_cxx::__scoped_lock sentry(_M_get_mutex()); @@ -479,7 +479,7 @@ namespace __gnu_debug } void - _Safe_unordered_sequence_base:: + _Safe_unordered_container_base:: _M_attach_local_single(_Safe_iterator_base* __it, bool __constant) throw () { _Safe_iterator_base*& __its = @@ -491,19 +491,19 @@ namespace __gnu_debug } void - _Safe_unordered_sequence_base:: + _Safe_unordered_container_base:: _M_detach_local(_Safe_iterator_base* __it) { - // Remove __it from this sequence's list + // Remove __it from this container's list __gnu_cxx::__scoped_lock sentry(_M_get_mutex()); _M_detach_local_single(__it); } void - _Safe_unordered_sequence_base:: + _Safe_unordered_container_base:: _M_detach_local_single(_Safe_iterator_base* __it) throw () { - // Remove __it from this sequence's list + // Remove __it from this container's list __it->_M_unlink(); if (_M_const_local_iterators == __it) _M_const_local_iterators = __it->_M_next;