mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 23:25:24 +02:00
6ff4e7181c5f1748bc9aecc292369893a0fa790b
The unordered containers have 2 types of iterators, the usual ones and the local_iterator to iterate through a given bucket. In _GLIBCXX_DEBUG mode there are then 4 lists of iterators, 2 for iterator/const_iterator and 2 for local_iterator/const_local_iterator. This patch is making sure that the unordered container's mutex is only lock/unlock 1 time when those lists of iterators needed to be iterate for invalidation purpose. Also remove calls to _M_check_rehashed after erase operations. Standard do not permit to rehash on erase operation so we will never implement it. libstdc++-v3/ChangeLog * include/debug/safe_unordered_container.h (_Safe_unordered_container::_M_invalidate_locals): Remove. (_Safe_unordered_container::_M_invalidate_all): Lock mutex while calling _M_invalidate_if and _M_invalidate_locals. (_Safe_unordered_container::_M_invalidate_all_if): New. (_Safe_unordered_container::_M_invalidate): New. (_Safe_unordered_container::_M_invalidate_if): Make private, add __scoped_lock argument. (_Safe_unordered_container::_M_invalidate_local_if): Likewise. * include/debug/safe_unordered_container.tcc (_Safe_unordered_container::_M_invalidate_if): Adapt and remove lock. (_Safe_unordered_container::_M_invalidate_local_if): Likewise. * include/debug/unordered_map (unordered_map::erase(const_iterator, const_iterator)): Lock before loop on iterators. Remove _M_check_rehashed call. (unordered_map::_M_self): New. (unordered_map::_M_invalidate): Remove. (unordered_map::_M_erase): Adapt and remove _M_check_rehashed call. (unordered_multimap::_M_erase(_Base_iterator, _Base_iterator)): New. (unordered_multimap::erase(_Kt&&)): Use latter. (unordered_multimap::erase(const key_type&)): Likewise. (unordered_multimap::erase(const_iterator, const_iterator)): Lock before loop on iterators. Remove _M_check_rehashed. (unordered_multimap::_M_self): New. (unordered_multimap::_M_invalidate): Remove. (unordered_multimap::_M_erase): Adapt. Remove _M_check_rehashed call. * include/debug/unordered_set (unordered_set::erase(const_iterator, const_iterator)): Add lock before loop for iterator invalidation. Remove _M_check_rehashed call. (unordered_set::_M_self): New. (unordered_set::_M_invalidate): Remove. (unordered_set::_M_erase): Adapt and remove _M_check_rehashed call. (unordered_multiset::_M_erase(_Base_iterator, _Base_iterator)): New. (unordered_multiset::erase(_Kt&&)): Use latter. (unordered_multiset::erase(const key_type&)): Likewise. (unordered_multiset::erase(const_iterator, const_iterator)): Lock before loop on iterators. Remove _M_check_rehashed. (unordered_multiset::_M_self): New. (unordered_multiset::_M_invalidate): Remove. (unordered_multiset::_M_erase): Adapt. Remove _M_check_rehashed call. Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
…
…
…
…
…
…
…
…
…
…
…
…
…
…
This directory contains the GNU Compiler Collection (GCC). The GNU Compiler Collection is free software. See the files whose names start with COPYING for copying permission. The manuals, and some of the runtime libraries, are under different terms; see the individual source files for details. The directory INSTALL contains copies of the installation information as HTML and plain text. The source of this information is gcc/doc/install.texi. The installation information includes details of what is included in the GCC sources and what files GCC installs. See the file gcc/doc/gcc.texi (together with other files that it includes) for usage and porting information. An online readable version of the manual is in the files gcc/doc/gcc.info*. See http://gcc.gnu.org/bugs/ for how to report bugs usefully. Copyright years on GCC source files may be listed using range notation, e.g., 1987-2012, indicating that every year in the range, inclusive, is a copyrightable year that could otherwise be listed individually.
Description
Languages
C++
30.8%
C
30.2%
Ada
14.4%
D
6.1%
Go
5.7%
Other
12.3%