gcc/libstdc++-v3/include/profile/unordered_map

587 lines
17 KiB
Plaintext
Raw Normal View History

// Profiling unordered_map/unordered_multimap implementation -*- C++ -*-
// Copyright (C) 2009-2017 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 along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
/** @file profile/unordered_map
* This file is a GNU profile extension to the Standard C++ Library.
*/
#ifndef _GLIBCXX_PROFILE_UNORDERED_MAP
#define _GLIBCXX_PROFILE_UNORDERED_MAP 1
#if __cplusplus < 201103L
hashtable.h: Fold in include/tr1_impl/hashtable.h contents. 2010-02-10 Paolo Carlini <paolo.carlini@oracle.com> * include/tr1/hashtable.h: Fold in include/tr1_impl/hashtable.h contents. * include/tr1_impl/hashtable.h: Remove. * include/tr1_impl/hashtable_policy.h: Move and rename... * include/tr1/hashtable_policy.h: ... here. * include/tr1_impl/unordered_map: Move and rename... * include/tr1/unordered_map.h: ... here. * include/tr1_impl/unordered_set: Move and rename... * include/tr1/unordered_set.h: ... here. * include/tr1_impl/unordered_map: Move and rename... * include/tr1/unordered_map.h: ... here. * include/tr1/unordered_map: Adjust. * include/tr1/unordered_set: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/std/c++0x_warning.h: Move... * include/bits/c++0x_warning.h: ... here. * include/debug/unordered_map: Adjust. * include/debug/unordered_set: Likewise. * include/std/tuple: Likewise. * include/std/system_error: Likewise. * include/std/forward_list: Likewise. * include/std/thread: Likewise. * include/std/type_traits: Likewise. * include/std/future: Likewise. * include/std/regex: Likewise. * include/std/atomic: Likewise. * include/std/ratio: Likewise. * include/std/random: Likewise. * include/std/unordered_map: Likewise. * include/std/chrono: Likewise.: Likewise. * include/std/condition_variable: Likewise. * include/std/mutex: Likewise. * include/std/unordered_set: Likewise. * include/std/array: Likewise. * include/profile/unordered_map: Likewise. * include/profile/unordered_set: Likewise. * include/c_global/cinttypes: Likewise. * include/c_global/ctgmath: Likewise. * include/c_global/cfenv: Likewise. * include/c_global/cstdint: Likewise. * include/c_global/cstdbool: Likewise. * include/c_global/ccomplex: Likewise. * include/bits/shared_ptr.h: Do not include <bits/c++0x_warning.h> at all, the file is not meant to be included by the users. * include/bits/functional_hash.h: Likewise. * include/bits/unique_ptr.h: Likewise. * include/bits/forward_list.h: Likewise. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust dg-* line numbers. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Likewise. * testsuite/20_util/unique_ptr/assign/assign_neg.cc: Likewise. From-SVN: r156667
2010-02-10 20:14:33 +01:00
# include <bits/c++0x_warning.h>
#else
# include <unordered_map>
#include <profile/base.h>
#include <profile/unordered_base.h>
#define _GLIBCXX_BASE unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>
PR libstdc++/36104 part four 2011-01-30 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/36104 part four * include/bits/c++config (_GLIBCXX_STD): Remove. (_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C. (_GLIBCXX_P): Now _GLIBCXX_STD_A. (_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL, _GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove. (_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL, _GLIBCXX_INLINE_PROFILE): Remove. (_GLIBCXX_BEGIN_NAMESPACE(X)): Remove. (_GLIBCXX_END_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove. (_GLIBCXX_END_NESTED_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add. (_GLIBCXX_END_NAMESPACE_ALGO): Add. (_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add. (_GLIBCXX_END_NAMESPACE_CONTAINER): Add. (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add. (_GLIBCXX_END_NAMESPACE_VERSION): Add. (_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL. (_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL. (_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY. * include/*: Use new macros for namespace scope. * config/*: Same. * src/*: Same. * src/Makefile.am (sources): Remove debug_list.cc, add compatibility-debug_list-2.cc. (parallel_sources): Remove parallel_list.cc, add compatibility-parallel_list-2.cc. (compatibility-parallel_list-2.[o,lo]): New rule. * src/Makefile.in: Regenerate. * src/debug_list.cc: Remove. * src/parallel_list.cc: Remove. * src/compatibility-list-2.cc: New. * src/compatibility-debug_list-2.cc: New. * src/compatibility-parallel_list-2.cc: New. * doc/doxygen/user.cfg.in: Adjust macros. * testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros. * testsuite/20_util/declval/requirements/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/forward/c_neg.cc: Same. * testsuite/20_util/forward/f_neg.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/forward_list/capacity/1.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Same. * testsuite/23_containers/list/capacity/29134.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/bool/capacity/29134.cc: Same. * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/25_algorithms/sort/35588.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/ext/profile/mutex_extensions_neg.cc: Same. * testsuite/ext/profile/profiler_algos.cc: Same. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same. From-SVN: r169421
2011-01-30 23:39:36 +01:00
#define _GLIBCXX_STD_BASE _GLIBCXX_STD_C::_GLIBCXX_BASE
PR libstdc++/36104 part four 2011-01-30 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/36104 part four * include/bits/c++config (_GLIBCXX_STD): Remove. (_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C. (_GLIBCXX_P): Now _GLIBCXX_STD_A. (_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL, _GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove. (_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL, _GLIBCXX_INLINE_PROFILE): Remove. (_GLIBCXX_BEGIN_NAMESPACE(X)): Remove. (_GLIBCXX_END_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove. (_GLIBCXX_END_NESTED_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add. (_GLIBCXX_END_NAMESPACE_ALGO): Add. (_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add. (_GLIBCXX_END_NAMESPACE_CONTAINER): Add. (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add. (_GLIBCXX_END_NAMESPACE_VERSION): Add. (_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL. (_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL. (_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY. * include/*: Use new macros for namespace scope. * config/*: Same. * src/*: Same. * src/Makefile.am (sources): Remove debug_list.cc, add compatibility-debug_list-2.cc. (parallel_sources): Remove parallel_list.cc, add compatibility-parallel_list-2.cc. (compatibility-parallel_list-2.[o,lo]): New rule. * src/Makefile.in: Regenerate. * src/debug_list.cc: Remove. * src/parallel_list.cc: Remove. * src/compatibility-list-2.cc: New. * src/compatibility-debug_list-2.cc: New. * src/compatibility-parallel_list-2.cc: New. * doc/doxygen/user.cfg.in: Adjust macros. * testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros. * testsuite/20_util/declval/requirements/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/forward/c_neg.cc: Same. * testsuite/20_util/forward/f_neg.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/forward_list/capacity/1.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Same. * testsuite/23_containers/list/capacity/29134.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/bool/capacity/29134.cc: Same. * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/25_algorithms/sort/35588.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/ext/profile/mutex_extensions_neg.cc: Same. * testsuite/ext/profile/profiler_algos.cc: Same. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same. From-SVN: r169421
2011-01-30 23:39:36 +01:00
namespace std _GLIBCXX_VISIBILITY(default)
{
namespace __profile
{
/// Class std::unordered_map wrapper with performance instrumentation.
template<typename _Key, typename _Tp,
typename _Hash = std::hash<_Key>,
typename _Pred = std::equal_to<_Key>,
typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
class unordered_map
: public _GLIBCXX_STD_BASE,
public _Unordered_profile<unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>,
true>
{
typedef typename _GLIBCXX_STD_BASE _Base;
_Base&
_M_base() noexcept { return *this; }
const _Base&
_M_base() const noexcept { return *this; }
public:
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
typedef typename _Base::allocator_type allocator_type;
typedef typename _Base::key_type key_type;
typedef typename _Base::value_type value_type;
typedef typename _Base::difference_type difference_type;
typedef typename _Base::reference reference;
typedef typename _Base::const_reference const_reference;
typedef typename _Base::mapped_type mapped_type;
typedef typename _Base::iterator iterator;
typedef typename _Base::const_iterator const_iterator;
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
unordered_map() = default;
explicit
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
unordered_map(size_type __n,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__n, __hf, __eql, __a) { }
template<typename _InputIterator>
unordered_map(_InputIterator __f, _InputIterator __l,
hashtable.h (_Hashtable<>::operator=(const _Hashtable&)): Move inline. 2010-08-13 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h (_Hashtable<>::operator=(const _Hashtable&)): Move inline. (operator=(_Hashtable&&)): Define. * include/bits/unordered_map.h (unordered_map(unordered_map&&), unordered_map(const unordered_map&), unordered_multimap (unordered_multimap&&), unordered_multimap(const unordered_multimap&), __unordered_map(__unordered_map&&), __unordered_map(const __unordered_map&), __unordered_multimap(__unordered_multimap&&), __unordered_multimap(const __unordered_multimap&)): Do not define, leave implicit. * include/bits/unordered_set.h (unordered_set(unordered_set&&), unordered_set(const unordered_set&), unordered_multiset (unordered_multiset&&), unordered_multiset(const unordered_multiset&), __unordered_set(__unordered_set&&), __unordered_set(const __unordered_set&), __unordered_multiset(__unordered_multiset&&), __unordered_multiset(const __unordered_multiset&)): Likewise. * include/bits/unordered_map.h (__unordered_map(initializer_list<>), __unordered_map<>::operator=(initializer_list<>), __unordered_multimap(initializer_list<>), __unordered_multimap<>:: operator=(initializer_list<>)): Add. * include/bits/unordered_set.h (__unordered_set(initializer_list<>), __unordered_set<>::operator=(initializer_list<>), __unordered_multiset(initializer_list<>), __unordered_multiset<>:: operator=(initializer_list<>)): Likewise. * include/bits/unordered_map.h (__unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Fix __n default to 0. * include/bits/unordered_set.h (__unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. * include/debug/unordered_map (unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Likewise. * include/debug/unordered_set (unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. * include/profile/unordered_map (unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Likewise. * include/profile/unordered_set (unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. From-SVN: r163236
2010-08-14 03:00:23 +02:00
size_type __n = 0,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__f, __l, __n, __hf, __eql, __a) { }
unordered_map(const unordered_map&) = default;
unordered_map(const _Base& __x)
: _Base(__x) { }
unordered_map(unordered_map&&) = default;
explicit
unordered_map(const allocator_type& __a)
: _Base(__a) { }
unordered_map(const unordered_map& __umap,
const allocator_type& __a)
: _Base(__umap, __a) { }
unordered_map(unordered_map&& __umap,
const allocator_type& __a)
: _Base(std::move(__umap._M_base()), __a) { }
unordered_map(initializer_list<value_type> __l,
hashtable.h (_Hashtable<>::operator=(const _Hashtable&)): Move inline. 2010-08-13 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h (_Hashtable<>::operator=(const _Hashtable&)): Move inline. (operator=(_Hashtable&&)): Define. * include/bits/unordered_map.h (unordered_map(unordered_map&&), unordered_map(const unordered_map&), unordered_multimap (unordered_multimap&&), unordered_multimap(const unordered_multimap&), __unordered_map(__unordered_map&&), __unordered_map(const __unordered_map&), __unordered_multimap(__unordered_multimap&&), __unordered_multimap(const __unordered_multimap&)): Do not define, leave implicit. * include/bits/unordered_set.h (unordered_set(unordered_set&&), unordered_set(const unordered_set&), unordered_multiset (unordered_multiset&&), unordered_multiset(const unordered_multiset&), __unordered_set(__unordered_set&&), __unordered_set(const __unordered_set&), __unordered_multiset(__unordered_multiset&&), __unordered_multiset(const __unordered_multiset&)): Likewise. * include/bits/unordered_map.h (__unordered_map(initializer_list<>), __unordered_map<>::operator=(initializer_list<>), __unordered_multimap(initializer_list<>), __unordered_multimap<>:: operator=(initializer_list<>)): Add. * include/bits/unordered_set.h (__unordered_set(initializer_list<>), __unordered_set<>::operator=(initializer_list<>), __unordered_multiset(initializer_list<>), __unordered_multiset<>:: operator=(initializer_list<>)): Likewise. * include/bits/unordered_map.h (__unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Fix __n default to 0. * include/bits/unordered_set.h (__unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. * include/debug/unordered_map (unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Likewise. * include/debug/unordered_set (unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. * include/profile/unordered_map (unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Likewise. * include/profile/unordered_set (unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. From-SVN: r163236
2010-08-14 03:00:23 +02:00
size_type __n = 0,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__l, __n, __hf, __eql, __a) { }
unordered_map(size_type __n, const allocator_type& __a)
: unordered_map(__n, hasher(), key_equal(), __a)
{ }
unordered_map(size_type __n, const hasher& __hf,
const allocator_type& __a)
: unordered_map(__n, __hf, key_equal(), __a)
{ }
template<typename _InputIterator>
unordered_map(_InputIterator __first, _InputIterator __last,
size_type __n,
const allocator_type& __a)
: unordered_map(__first, __last, __n, hasher(), key_equal(), __a)
{ }
template<typename _InputIterator>
unordered_map(_InputIterator __first, _InputIterator __last,
size_type __n, const hasher& __hf,
const allocator_type& __a)
: unordered_map(__first, __last, __n, __hf, key_equal(), __a)
{ }
unordered_map(initializer_list<value_type> __l,
size_type __n,
const allocator_type& __a)
: unordered_map(__l, __n, hasher(), key_equal(), __a)
{ }
unordered_map(initializer_list<value_type> __l,
size_type __n, const hasher& __hf,
const allocator_type& __a)
: unordered_map(__l, __n, __hf, key_equal(), __a)
{ }
unordered_map&
operator=(const unordered_map&) = default;
unordered_map&
operator=(unordered_map&&) = default;
unordered_map&
operator=(initializer_list<value_type> __l)
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_destruct();
_M_base() = __l;
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_construct();
return *this;
}
void
clear() noexcept
{
this->_M_profile_destruct();
_Base::clear();
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_construct();
}
template<typename... _Args>
std::pair<iterator, bool>
emplace(_Args&&... __args)
{
size_type __old_size = _Base::bucket_count();
std::pair<iterator, bool> __res
= _Base::emplace(std::forward<_Args>(__args)...);
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_resize(__old_size);
return __res;
}
template<typename... _Args>
iterator
emplace_hint(const_iterator __it, _Args&&... __args)
{
size_type __old_size = _Base::bucket_count();
iterator __res
= _Base::emplace_hint(__it, std::forward<_Args>(__args)...);
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_resize(__old_size);
return __res;
}
void
insert(std::initializer_list<value_type> __l)
{
size_type __old_size = _Base::bucket_count();
_Base::insert(__l);
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_resize(__old_size);
}
std::pair<iterator, bool>
insert(const value_type& __obj)
{
size_type __old_size = _Base::bucket_count();
std::pair<iterator, bool> __res = _Base::insert(__obj);
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_resize(__old_size);
return __res;
}
iterator
insert(const_iterator __iter, const value_type& __v)
{
size_type __old_size = _Base::bucket_count();
iterator __res = _Base::insert(__iter, __v);
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_resize(__old_size);
return __res;
}
2010-10-28 18:01:05 +02:00
template<typename _Pair, typename = typename
std::enable_if<std::is_constructible<value_type,
_Pair&&>::value>::type>
std::pair<iterator, bool>
insert(_Pair&& __obj)
{
size_type __old_size = _Base::bucket_count();
2010-10-28 18:01:05 +02:00
std::pair<iterator, bool> __res
= _Base::insert(std::forward<_Pair>(__obj));
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_resize(__old_size);
2010-10-28 18:01:05 +02:00
return __res;
}
template<typename _Pair, typename = typename
std::enable_if<std::is_constructible<value_type,
_Pair&&>::value>::type>
iterator
insert(const_iterator __iter, _Pair&& __v)
{
size_type __old_size = _Base::bucket_count();
2010-10-28 18:01:05 +02:00
iterator __res = _Base::insert(__iter, std::forward<_Pair>(__v));
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_resize(__old_size);
2010-10-28 18:01:05 +02:00
return __res;
}
template<typename _InputIter>
void
insert(_InputIter __first, _InputIter __last)
{
size_type __old_size = _Base::bucket_count();
_Base::insert(__first, __last);
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_resize(__old_size);
hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use. 2010-02-10 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use. * include/bits/hashtable_policy.h: New, copy and adjust for C++0x use, include/tr1_impl/hashtable_policy.h; fix erase and insert member functions per n3000. * include/bits/unordered_map.h: Likewise for include/tr1_impl/ unordered_map. * include/bits/unordered_set.h: Likewise for include/tr1_impl/ unordered_set. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/tr1/unordered_map: Adjust. * include/tr1/unordered_set: Likewise. * include/tr1_impl/unordered_map: Adjust, now used only by tr1. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/std/unordered_map: Adjust and simplify includes. * include/std/unordered_set: Likewise. * include/debug/unordered_map: Adjuse erase and insert members. * include/debug/unordered_set: Likewise. * include/profile/unordered_map: Likewise. * include/profile/unordered_set: Likewise. * testsuite/util/exception/safety.h: Fix for the updated erase and insert member functions of the unordered_containers. * testsuite/23_containers/unordered_map/erase/1.cc: New. * testsuite/23_containers/unordered_map/erase/24061-map.cc: Likewise. * testsuite/23_containers/unordered_map/insert/map_single.cc: Likewise. * testsuite/23_containers/unordered_map/insert/array_syntax.cc: Likewise. * testsuite/23_containers/unordered_map/insert/24061-map.cc: Likewise. * testsuite/23_containers/unordered_map/insert/map_range.cc: Likewise. * testsuite/23_containers/set/operators/1_neg.cc: Likewise. * testsuite/23_containers/unordered_multimap/erase/1.cc: Likewise. * testsuite/23_containers/unordered_multimap/erase/ 24061-multimap.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ 24061-multimap.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ multimap_range.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ multimap_single.cc: Likewise. * testsuite/23_containers/unordered_set/erase/1.cc: Likewise. * testsuite/23_containers/unordered_set/erase/24061-set.cc: Likewise. * testsuite/23_containers/unordered_set/insert/set_single.cc: Likewise. * testsuite/23_containers/unordered_set/insert/24061-set.cc: Likewise. * testsuite/23_containers/unordered_set/insert/set_range.cc: Likewise. * testsuite/23_containers/unordered_multiset/erase/1.cc: Likewise. * testsuite/23_containers/unordered_multiset/erase/ 24061-multiset.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ 24061-multiset.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ multiset_range.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ multiset_single.cc: Likewise. * testsuite/23_containers/set/operators/1_neg.cc: Tweak dg-errors to avoid spurious fails in debug-mode. * testsuite/23_containers/map/operators/1_neg.cc: Likewise. From-SVN: r156661
2010-02-10 17:09:42 +01:00
}
// operator[]
mapped_type&
operator[](const _Key& __k)
{
size_type __old_size = _Base::bucket_count();
mapped_type& __res = _M_base()[__k];
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_resize(__old_size);
return __res;
}
mapped_type&
operator[](_Key&& __k)
{
size_type __old_size = _Base::bucket_count();
mapped_type& __res = _M_base()[std::move(__k)];
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_resize(__old_size);
return __res;
}
void
swap(unordered_map& __x)
noexcept( noexcept(__x._M_base().swap(__x)) )
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
{
_Base::swap(__x._M_base());
this->_M_swap(__x);
}
hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use. 2010-02-10 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use. * include/bits/hashtable_policy.h: New, copy and adjust for C++0x use, include/tr1_impl/hashtable_policy.h; fix erase and insert member functions per n3000. * include/bits/unordered_map.h: Likewise for include/tr1_impl/ unordered_map. * include/bits/unordered_set.h: Likewise for include/tr1_impl/ unordered_set. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/tr1/unordered_map: Adjust. * include/tr1/unordered_set: Likewise. * include/tr1_impl/unordered_map: Adjust, now used only by tr1. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/std/unordered_map: Adjust and simplify includes. * include/std/unordered_set: Likewise. * include/debug/unordered_map: Adjuse erase and insert members. * include/debug/unordered_set: Likewise. * include/profile/unordered_map: Likewise. * include/profile/unordered_set: Likewise. * testsuite/util/exception/safety.h: Fix for the updated erase and insert member functions of the unordered_containers. * testsuite/23_containers/unordered_map/erase/1.cc: New. * testsuite/23_containers/unordered_map/erase/24061-map.cc: Likewise. * testsuite/23_containers/unordered_map/insert/map_single.cc: Likewise. * testsuite/23_containers/unordered_map/insert/array_syntax.cc: Likewise. * testsuite/23_containers/unordered_map/insert/24061-map.cc: Likewise. * testsuite/23_containers/unordered_map/insert/map_range.cc: Likewise. * testsuite/23_containers/set/operators/1_neg.cc: Likewise. * testsuite/23_containers/unordered_multimap/erase/1.cc: Likewise. * testsuite/23_containers/unordered_multimap/erase/ 24061-multimap.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ 24061-multimap.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ multimap_range.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ multimap_single.cc: Likewise. * testsuite/23_containers/unordered_set/erase/1.cc: Likewise. * testsuite/23_containers/unordered_set/erase/24061-set.cc: Likewise. * testsuite/23_containers/unordered_set/insert/set_single.cc: Likewise. * testsuite/23_containers/unordered_set/insert/24061-set.cc: Likewise. * testsuite/23_containers/unordered_set/insert/set_range.cc: Likewise. * testsuite/23_containers/unordered_multiset/erase/1.cc: Likewise. * testsuite/23_containers/unordered_multiset/erase/ 24061-multiset.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ 24061-multiset.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ multiset_range.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ multiset_single.cc: Likewise. * testsuite/23_containers/set/operators/1_neg.cc: Tweak dg-errors to avoid spurious fails in debug-mode. * testsuite/23_containers/map/operators/1_neg.cc: Likewise. From-SVN: r156661
2010-02-10 17:09:42 +01:00
void rehash(size_type __n)
{
size_type __old_size = _Base::bucket_count();
_Base::rehash(__n);
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_resize(__old_size);
}
};
hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use. 2010-02-10 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use. * include/bits/hashtable_policy.h: New, copy and adjust for C++0x use, include/tr1_impl/hashtable_policy.h; fix erase and insert member functions per n3000. * include/bits/unordered_map.h: Likewise for include/tr1_impl/ unordered_map. * include/bits/unordered_set.h: Likewise for include/tr1_impl/ unordered_set. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/tr1/unordered_map: Adjust. * include/tr1/unordered_set: Likewise. * include/tr1_impl/unordered_map: Adjust, now used only by tr1. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/std/unordered_map: Adjust and simplify includes. * include/std/unordered_set: Likewise. * include/debug/unordered_map: Adjuse erase and insert members. * include/debug/unordered_set: Likewise. * include/profile/unordered_map: Likewise. * include/profile/unordered_set: Likewise. * testsuite/util/exception/safety.h: Fix for the updated erase and insert member functions of the unordered_containers. * testsuite/23_containers/unordered_map/erase/1.cc: New. * testsuite/23_containers/unordered_map/erase/24061-map.cc: Likewise. * testsuite/23_containers/unordered_map/insert/map_single.cc: Likewise. * testsuite/23_containers/unordered_map/insert/array_syntax.cc: Likewise. * testsuite/23_containers/unordered_map/insert/24061-map.cc: Likewise. * testsuite/23_containers/unordered_map/insert/map_range.cc: Likewise. * testsuite/23_containers/set/operators/1_neg.cc: Likewise. * testsuite/23_containers/unordered_multimap/erase/1.cc: Likewise. * testsuite/23_containers/unordered_multimap/erase/ 24061-multimap.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ 24061-multimap.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ multimap_range.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ multimap_single.cc: Likewise. * testsuite/23_containers/unordered_set/erase/1.cc: Likewise. * testsuite/23_containers/unordered_set/erase/24061-set.cc: Likewise. * testsuite/23_containers/unordered_set/insert/set_single.cc: Likewise. * testsuite/23_containers/unordered_set/insert/24061-set.cc: Likewise. * testsuite/23_containers/unordered_set/insert/set_range.cc: Likewise. * testsuite/23_containers/unordered_multiset/erase/1.cc: Likewise. * testsuite/23_containers/unordered_multiset/erase/ 24061-multiset.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ 24061-multiset.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ multiset_range.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ multiset_single.cc: Likewise. * testsuite/23_containers/set/operators/1_neg.cc: Tweak dg-errors to avoid spurious fails in debug-mode. * testsuite/23_containers/map/operators/1_neg.cc: Likewise. From-SVN: r156661
2010-02-10 17:09:42 +01:00
template<typename _Key, typename _Tp, typename _Hash,
hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use. 2010-02-10 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use. * include/bits/hashtable_policy.h: New, copy and adjust for C++0x use, include/tr1_impl/hashtable_policy.h; fix erase and insert member functions per n3000. * include/bits/unordered_map.h: Likewise for include/tr1_impl/ unordered_map. * include/bits/unordered_set.h: Likewise for include/tr1_impl/ unordered_set. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/tr1/unordered_map: Adjust. * include/tr1/unordered_set: Likewise. * include/tr1_impl/unordered_map: Adjust, now used only by tr1. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/std/unordered_map: Adjust and simplify includes. * include/std/unordered_set: Likewise. * include/debug/unordered_map: Adjuse erase and insert members. * include/debug/unordered_set: Likewise. * include/profile/unordered_map: Likewise. * include/profile/unordered_set: Likewise. * testsuite/util/exception/safety.h: Fix for the updated erase and insert member functions of the unordered_containers. * testsuite/23_containers/unordered_map/erase/1.cc: New. * testsuite/23_containers/unordered_map/erase/24061-map.cc: Likewise. * testsuite/23_containers/unordered_map/insert/map_single.cc: Likewise. * testsuite/23_containers/unordered_map/insert/array_syntax.cc: Likewise. * testsuite/23_containers/unordered_map/insert/24061-map.cc: Likewise. * testsuite/23_containers/unordered_map/insert/map_range.cc: Likewise. * testsuite/23_containers/set/operators/1_neg.cc: Likewise. * testsuite/23_containers/unordered_multimap/erase/1.cc: Likewise. * testsuite/23_containers/unordered_multimap/erase/ 24061-multimap.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ 24061-multimap.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ multimap_range.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ multimap_single.cc: Likewise. * testsuite/23_containers/unordered_set/erase/1.cc: Likewise. * testsuite/23_containers/unordered_set/erase/24061-set.cc: Likewise. * testsuite/23_containers/unordered_set/insert/set_single.cc: Likewise. * testsuite/23_containers/unordered_set/insert/24061-set.cc: Likewise. * testsuite/23_containers/unordered_set/insert/set_range.cc: Likewise. * testsuite/23_containers/unordered_multiset/erase/1.cc: Likewise. * testsuite/23_containers/unordered_multiset/erase/ 24061-multiset.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ 24061-multiset.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ multiset_range.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ multiset_single.cc: Likewise. * testsuite/23_containers/set/operators/1_neg.cc: Tweak dg-errors to avoid spurious fails in debug-mode. * testsuite/23_containers/map/operators/1_neg.cc: Likewise. From-SVN: r156661
2010-02-10 17:09:42 +01:00
typename _Pred, typename _Alloc>
inline void
swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use. 2010-02-10 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use. * include/bits/hashtable_policy.h: New, copy and adjust for C++0x use, include/tr1_impl/hashtable_policy.h; fix erase and insert member functions per n3000. * include/bits/unordered_map.h: Likewise for include/tr1_impl/ unordered_map. * include/bits/unordered_set.h: Likewise for include/tr1_impl/ unordered_set. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/tr1/unordered_map: Adjust. * include/tr1/unordered_set: Likewise. * include/tr1_impl/unordered_map: Adjust, now used only by tr1. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/std/unordered_map: Adjust and simplify includes. * include/std/unordered_set: Likewise. * include/debug/unordered_map: Adjuse erase and insert members. * include/debug/unordered_set: Likewise. * include/profile/unordered_map: Likewise. * include/profile/unordered_set: Likewise. * testsuite/util/exception/safety.h: Fix for the updated erase and insert member functions of the unordered_containers. * testsuite/23_containers/unordered_map/erase/1.cc: New. * testsuite/23_containers/unordered_map/erase/24061-map.cc: Likewise. * testsuite/23_containers/unordered_map/insert/map_single.cc: Likewise. * testsuite/23_containers/unordered_map/insert/array_syntax.cc: Likewise. * testsuite/23_containers/unordered_map/insert/24061-map.cc: Likewise. * testsuite/23_containers/unordered_map/insert/map_range.cc: Likewise. * testsuite/23_containers/set/operators/1_neg.cc: Likewise. * testsuite/23_containers/unordered_multimap/erase/1.cc: Likewise. * testsuite/23_containers/unordered_multimap/erase/ 24061-multimap.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ 24061-multimap.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ multimap_range.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ multimap_single.cc: Likewise. * testsuite/23_containers/unordered_set/erase/1.cc: Likewise. * testsuite/23_containers/unordered_set/erase/24061-set.cc: Likewise. * testsuite/23_containers/unordered_set/insert/set_single.cc: Likewise. * testsuite/23_containers/unordered_set/insert/24061-set.cc: Likewise. * testsuite/23_containers/unordered_set/insert/set_range.cc: Likewise. * testsuite/23_containers/unordered_multiset/erase/1.cc: Likewise. * testsuite/23_containers/unordered_multiset/erase/ 24061-multiset.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ 24061-multiset.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ multiset_range.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ multiset_single.cc: Likewise. * testsuite/23_containers/set/operators/1_neg.cc: Tweak dg-errors to avoid spurious fails in debug-mode. * testsuite/23_containers/map/operators/1_neg.cc: Likewise. From-SVN: r156661
2010-02-10 17:09:42 +01:00
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
c++config (_GLIBCXX_NOEXCEPT_IF): Define. * include/bits/c++config (_GLIBCXX_NOEXCEPT_IF): Define. * include/bits/forward_list.h (forward_list::swap): Make noexcept unconditional. * include/bits/hashtable.h (_Hashtable::swap): Do not use _S_nothrow_swap(). * include/bits/stl_bvector.h (vector<bool>::swap): Make noexcept unconditional. * include/bits/stl_deque.h (deque::swap): Likewise. (swap(deque&, deque&)): Use _GLIBCXX_NOEXCEPT_IF. * include/bits/stl_list.h (list::swap): Make noexcept unconditional. (swap(list&, list&)): Use _GLIBCXX_NOEXCEPT_IF. * include/bits/stl_map.h (map::swap, swap(map&, map&)): Use _GLIBCXX_NOEXCEPT_IF, do not depend on _S_nothrow_swap. * include/bits/stl_multimap.h (multimap::swap, swap(multimap&, multimap&)): Likewise. * include/bits/stl_multiset.h (multiset::swap, swap(multiset&, multiset&)): Likewise. * include/bits/stl_set.h (set::swap, swap(set&, set&)): Likewise. * include/bits/stl_tree.h (_Rb_tree::swap, swap(_Rb_tree&, _Rb_tree&)): Likewise. * include/bits/stl_vector.h (vector::swap): Make noexcept unconditional. (swap(vector&, vector&)): Use _GLIBCXX_NOEXCEPT_IF. * include/debug/deque (deque::swap, swap): Likewise. * include/debug/forward_list (swap): Add noexcept. * include/debug/list (list::swap, swap): Use _GLIBCXX_NOEXCEPT_IF. * include/debug/map.h (map::swap, swap): Likewise. * include/debug/multimap.h (multimap::swap, swap): Likewise. * include/debug/multiset.h (multiset::Swap, swap): Likewise. * include/debug/set.h (set::swap, swap): Likewise. * include/debug/unordered_map (unordered_map::swap, unordered_multimap::swap, swap): Likewise. * include/debug/unordered_set (unordered_set::swap, unordered_multiset::swap, swap): Likewise. * include/debug/vector (vector::swap, swap): Likewise. * include/ext/alloc_traits.h (__alloc_traits::_S_nothrow_swap()): Remove. * include/profile/deque (deque::swap, swap): Use _GLIBCXX_NOEXCEPT_IF. * include/profile/forward_list (swap): Add noexcept. * include/profile/list (list::swap, swap) : Use _GLIBCXX_NOEXCEPT_IF. * include/profile/map.h (map::swap, swap): Likewise. * include/profile/multimap.h (multimap::swap, swap): Likewise. * include/profile/multiset.h (multiset::swap, swap): Likewise. * include/profile/set.h (set::swap, swap): Likewise. * include/profile/unordered_map (swap): Likewise. * include/profile/unordered_set (swap): Likewise. * include/profile/vector (vector::swap, swap): Likewise. Remove overloads for swapping rvalues. * testsuite/23_containers/deque/allocator/noexcept.cc: Update tests for noexcept on swap. * testsuite/23_containers/forward_list/allocator/noexcept.cc: Likewise. * testsuite/23_containers/list/allocator/noexcept.cc: Likewise. * testsuite/23_containers/map/allocator/noexcept.cc: Likewise. * testsuite/23_containers/multimap/allocator/noexcept.cc: Likewise. * testsuite/23_containers/multiset/allocator/noexcept.cc: Likewise. * testsuite/23_containers/set/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/noexcept.cc: Likewise. * testsuite/23_containers/vector/allocator/noexcept.cc: Likewise. * testsuite/23_containers/vector/bool/allocator/noexcept.cc: Likewise. * testsuite/ext/profile/mutex_extensions_neg.cc: Adjust dg-error line number. From-SVN: r225744
2015-07-13 19:15:48 +02:00
noexcept(noexcept(__x.swap(__y)))
{ __x.swap(__y); }
template<typename _Key, typename _Tp, typename _Hash,
typename _Pred, typename _Alloc>
inline bool
operator==(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return static_cast<const _GLIBCXX_STD_BASE&>(__x) == __y; }
template<typename _Key, typename _Tp, typename _Hash,
typename _Pred, typename _Alloc>
inline bool
operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return !(__x == __y); }
#undef _GLIBCXX_BASE
#undef _GLIBCXX_STD_BASE
#define _GLIBCXX_BASE unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>
PR libstdc++/36104 part four 2011-01-30 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/36104 part four * include/bits/c++config (_GLIBCXX_STD): Remove. (_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C. (_GLIBCXX_P): Now _GLIBCXX_STD_A. (_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL, _GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove. (_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL, _GLIBCXX_INLINE_PROFILE): Remove. (_GLIBCXX_BEGIN_NAMESPACE(X)): Remove. (_GLIBCXX_END_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove. (_GLIBCXX_END_NESTED_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add. (_GLIBCXX_END_NAMESPACE_ALGO): Add. (_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add. (_GLIBCXX_END_NAMESPACE_CONTAINER): Add. (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add. (_GLIBCXX_END_NAMESPACE_VERSION): Add. (_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL. (_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL. (_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY. * include/*: Use new macros for namespace scope. * config/*: Same. * src/*: Same. * src/Makefile.am (sources): Remove debug_list.cc, add compatibility-debug_list-2.cc. (parallel_sources): Remove parallel_list.cc, add compatibility-parallel_list-2.cc. (compatibility-parallel_list-2.[o,lo]): New rule. * src/Makefile.in: Regenerate. * src/debug_list.cc: Remove. * src/parallel_list.cc: Remove. * src/compatibility-list-2.cc: New. * src/compatibility-debug_list-2.cc: New. * src/compatibility-parallel_list-2.cc: New. * doc/doxygen/user.cfg.in: Adjust macros. * testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros. * testsuite/20_util/declval/requirements/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/forward/c_neg.cc: Same. * testsuite/20_util/forward/f_neg.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/forward_list/capacity/1.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Same. * testsuite/23_containers/list/capacity/29134.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/bool/capacity/29134.cc: Same. * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/25_algorithms/sort/35588.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/ext/profile/mutex_extensions_neg.cc: Same. * testsuite/ext/profile/profiler_algos.cc: Same. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same. From-SVN: r169421
2011-01-30 23:39:36 +01:00
#define _GLIBCXX_STD_BASE _GLIBCXX_STD_C::_GLIBCXX_BASE
/// Class std::unordered_multimap wrapper with performance instrumentation.
template<typename _Key, typename _Tp,
typename _Hash = std::hash<_Key>,
typename _Pred = std::equal_to<_Key>,
typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
class unordered_multimap
: public _GLIBCXX_STD_BASE,
public _Unordered_profile<unordered_multimap<_Key, _Tp,
_Hash, _Pred, _Alloc>,
false>
{
typedef typename _GLIBCXX_STD_BASE _Base;
_Base&
_M_base() noexcept { return *this; }
const _Base&
_M_base() const noexcept { return *this; }
public:
typedef typename _Base::size_type size_type;
typedef typename _Base::hasher hasher;
typedef typename _Base::key_equal key_equal;
typedef typename _Base::allocator_type allocator_type;
typedef typename _Base::key_type key_type;
typedef typename _Base::value_type value_type;
typedef typename _Base::difference_type difference_type;
typedef typename _Base::reference reference;
typedef typename _Base::const_reference const_reference;
typedef typename _Base::iterator iterator;
typedef typename _Base::const_iterator const_iterator;
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
unordered_multimap() = default;
explicit
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
unordered_multimap(size_type __n,
hashtable.h (_Hashtable<>::operator=(const _Hashtable&)): Move inline. 2010-08-13 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h (_Hashtable<>::operator=(const _Hashtable&)): Move inline. (operator=(_Hashtable&&)): Define. * include/bits/unordered_map.h (unordered_map(unordered_map&&), unordered_map(const unordered_map&), unordered_multimap (unordered_multimap&&), unordered_multimap(const unordered_multimap&), __unordered_map(__unordered_map&&), __unordered_map(const __unordered_map&), __unordered_multimap(__unordered_multimap&&), __unordered_multimap(const __unordered_multimap&)): Do not define, leave implicit. * include/bits/unordered_set.h (unordered_set(unordered_set&&), unordered_set(const unordered_set&), unordered_multiset (unordered_multiset&&), unordered_multiset(const unordered_multiset&), __unordered_set(__unordered_set&&), __unordered_set(const __unordered_set&), __unordered_multiset(__unordered_multiset&&), __unordered_multiset(const __unordered_multiset&)): Likewise. * include/bits/unordered_map.h (__unordered_map(initializer_list<>), __unordered_map<>::operator=(initializer_list<>), __unordered_multimap(initializer_list<>), __unordered_multimap<>:: operator=(initializer_list<>)): Add. * include/bits/unordered_set.h (__unordered_set(initializer_list<>), __unordered_set<>::operator=(initializer_list<>), __unordered_multiset(initializer_list<>), __unordered_multiset<>:: operator=(initializer_list<>)): Likewise. * include/bits/unordered_map.h (__unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Fix __n default to 0. * include/bits/unordered_set.h (__unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. * include/debug/unordered_map (unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Likewise. * include/debug/unordered_set (unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. * include/profile/unordered_map (unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Likewise. * include/profile/unordered_set (unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. From-SVN: r163236
2010-08-14 03:00:23 +02:00
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__n, __hf, __eql, __a) { }
template<typename _InputIterator>
unordered_multimap(_InputIterator __f, _InputIterator __l,
hashtable.h (_Hashtable<>::operator=(const _Hashtable&)): Move inline. 2010-08-13 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h (_Hashtable<>::operator=(const _Hashtable&)): Move inline. (operator=(_Hashtable&&)): Define. * include/bits/unordered_map.h (unordered_map(unordered_map&&), unordered_map(const unordered_map&), unordered_multimap (unordered_multimap&&), unordered_multimap(const unordered_multimap&), __unordered_map(__unordered_map&&), __unordered_map(const __unordered_map&), __unordered_multimap(__unordered_multimap&&), __unordered_multimap(const __unordered_multimap&)): Do not define, leave implicit. * include/bits/unordered_set.h (unordered_set(unordered_set&&), unordered_set(const unordered_set&), unordered_multiset (unordered_multiset&&), unordered_multiset(const unordered_multiset&), __unordered_set(__unordered_set&&), __unordered_set(const __unordered_set&), __unordered_multiset(__unordered_multiset&&), __unordered_multiset(const __unordered_multiset&)): Likewise. * include/bits/unordered_map.h (__unordered_map(initializer_list<>), __unordered_map<>::operator=(initializer_list<>), __unordered_multimap(initializer_list<>), __unordered_multimap<>:: operator=(initializer_list<>)): Add. * include/bits/unordered_set.h (__unordered_set(initializer_list<>), __unordered_set<>::operator=(initializer_list<>), __unordered_multiset(initializer_list<>), __unordered_multiset<>:: operator=(initializer_list<>)): Likewise. * include/bits/unordered_map.h (__unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Fix __n default to 0. * include/bits/unordered_set.h (__unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. * include/debug/unordered_map (unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Likewise. * include/debug/unordered_set (unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. * include/profile/unordered_map (unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Likewise. * include/profile/unordered_set (unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. From-SVN: r163236
2010-08-14 03:00:23 +02:00
size_type __n = 0,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__f, __l, __n, __hf, __eql, __a) { }
unordered_multimap(const unordered_multimap&) = default;
unordered_multimap(const _Base& __x)
: _Base(__x) { }
unordered_multimap(unordered_multimap&&) = default;
explicit
unordered_multimap(const allocator_type& __a)
: _Base(__a) { }
unordered_multimap(const unordered_multimap& __ummap,
const allocator_type& __a)
: _Base(__ummap._M_base(), __a) { }
unordered_multimap(unordered_multimap&& __ummap,
const allocator_type& __a)
: _Base(std::move(__ummap._M_base()), __a) { }
unordered_multimap(initializer_list<value_type> __l,
hashtable.h (_Hashtable<>::operator=(const _Hashtable&)): Move inline. 2010-08-13 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h (_Hashtable<>::operator=(const _Hashtable&)): Move inline. (operator=(_Hashtable&&)): Define. * include/bits/unordered_map.h (unordered_map(unordered_map&&), unordered_map(const unordered_map&), unordered_multimap (unordered_multimap&&), unordered_multimap(const unordered_multimap&), __unordered_map(__unordered_map&&), __unordered_map(const __unordered_map&), __unordered_multimap(__unordered_multimap&&), __unordered_multimap(const __unordered_multimap&)): Do not define, leave implicit. * include/bits/unordered_set.h (unordered_set(unordered_set&&), unordered_set(const unordered_set&), unordered_multiset (unordered_multiset&&), unordered_multiset(const unordered_multiset&), __unordered_set(__unordered_set&&), __unordered_set(const __unordered_set&), __unordered_multiset(__unordered_multiset&&), __unordered_multiset(const __unordered_multiset&)): Likewise. * include/bits/unordered_map.h (__unordered_map(initializer_list<>), __unordered_map<>::operator=(initializer_list<>), __unordered_multimap(initializer_list<>), __unordered_multimap<>:: operator=(initializer_list<>)): Add. * include/bits/unordered_set.h (__unordered_set(initializer_list<>), __unordered_set<>::operator=(initializer_list<>), __unordered_multiset(initializer_list<>), __unordered_multiset<>:: operator=(initializer_list<>)): Likewise. * include/bits/unordered_map.h (__unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Fix __n default to 0. * include/bits/unordered_set.h (__unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. * include/debug/unordered_map (unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Likewise. * include/debug/unordered_set (unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. * include/profile/unordered_map (unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_map(initializer_list<>, size_type __n), unordered_map(_InputIterator, _InputIterator, size_type __n), unordered_multimap(initializer_list<>, size_type __n)): Likewise. * include/profile/unordered_set (unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_set(initializer_list<>, size_type __n), unordered_set(_InputIterator, _InputIterator, size_type __n), unordered_multiset(initializer_list<>, size_type __n)): Likewise. From-SVN: r163236
2010-08-14 03:00:23 +02:00
size_type __n = 0,
const hasher& __hf = hasher(),
const key_equal& __eql = key_equal(),
const allocator_type& __a = allocator_type())
: _Base(__l, __n, __hf, __eql, __a) { }
unordered_multimap(size_type __n, const allocator_type& __a)
: unordered_multimap(__n, hasher(), key_equal(), __a)
{ }
unordered_multimap(size_type __n, const hasher& __hf,
const allocator_type& __a)
: unordered_multimap(__n, __hf, key_equal(), __a)
{ }
template<typename _InputIterator>
unordered_multimap(_InputIterator __first, _InputIterator __last,
size_type __n,
const allocator_type& __a)
: unordered_multimap(__first, __last, __n, hasher(), key_equal(), __a)
{ }
template<typename _InputIterator>
unordered_multimap(_InputIterator __first, _InputIterator __last,
size_type __n, const hasher& __hf,
const allocator_type& __a)
: unordered_multimap(__first, __last, __n, __hf, key_equal(), __a)
{ }
unordered_multimap(initializer_list<value_type> __l,
size_type __n,
const allocator_type& __a)
: unordered_multimap(__l, __n, hasher(), key_equal(), __a)
{ }
unordered_multimap(initializer_list<value_type> __l,
size_type __n, const hasher& __hf,
const allocator_type& __a)
: unordered_multimap(__l, __n, __hf, key_equal(), __a)
{ }
unordered_multimap&
operator=(const unordered_multimap&) = default;
unordered_multimap&
operator=(unordered_multimap&&) = default;
unordered_multimap&
operator=(initializer_list<value_type> __l)
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_destruct();
_M_base() = __l;
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_construct();
return *this;
}
void
clear() noexcept
{
this->_M_profile_destruct();
_Base::clear();
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_construct();
}
template<typename... _Args>
iterator
emplace(_Args&&... __args)
{
size_type __old_size = _Base::bucket_count();
iterator __res
= _Base::emplace(std::forward<_Args>(__args)...);
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_resize(__old_size);
return __res;
}
template<typename... _Args>
iterator
emplace_hint(const_iterator __it, _Args&&... __args)
{
size_type __old_size = _Base::bucket_count();
iterator __res
= _Base::emplace_hint(__it, std::forward<_Args>(__args)...);
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_resize(__old_size);
return __res;
}
void
insert(std::initializer_list<value_type> __l)
{
size_type __old_size = _Base::bucket_count();
_Base::insert(__l);
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_resize(__old_size);
}
iterator
insert(const value_type& __obj)
{
size_type __old_size = _Base::bucket_count();
iterator __res = _Base::insert(__obj);
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_resize(__old_size);
return __res;
}
iterator
insert(const_iterator __iter, const value_type& __v)
{
size_type __old_size = _Base::bucket_count();
iterator __res = _Base::insert(__iter, __v);
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_resize(__old_size);
return __res;
}
2010-10-28 18:01:05 +02:00
template<typename _Pair, typename = typename
std::enable_if<std::is_constructible<value_type,
_Pair&&>::value>::type>
iterator
insert(_Pair&& __obj)
{
size_type __old_size = _Base::bucket_count();
2010-10-28 18:01:05 +02:00
iterator __res = _Base::insert(std::forward<_Pair>(__obj));
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_resize(__old_size);
2010-10-28 18:01:05 +02:00
return __res;
}
template<typename _Pair, typename = typename
std::enable_if<std::is_constructible<value_type,
_Pair&&>::value>::type>
iterator
insert(const_iterator __iter, _Pair&& __v)
{
size_type __old_size = _Base::bucket_count();
2010-10-28 18:01:05 +02:00
iterator __res = _Base::insert(__iter, std::forward<_Pair>(__v));
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_resize(__old_size);
2010-10-28 18:01:05 +02:00
return __res;
}
template<typename _InputIter>
void
insert(_InputIter __first, _InputIter __last)
{
size_type __old_size = _Base::bucket_count();
_Base::insert(__first, __last);
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_resize(__old_size);
hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use. 2010-02-10 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use. * include/bits/hashtable_policy.h: New, copy and adjust for C++0x use, include/tr1_impl/hashtable_policy.h; fix erase and insert member functions per n3000. * include/bits/unordered_map.h: Likewise for include/tr1_impl/ unordered_map. * include/bits/unordered_set.h: Likewise for include/tr1_impl/ unordered_set. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/tr1/unordered_map: Adjust. * include/tr1/unordered_set: Likewise. * include/tr1_impl/unordered_map: Adjust, now used only by tr1. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/std/unordered_map: Adjust and simplify includes. * include/std/unordered_set: Likewise. * include/debug/unordered_map: Adjuse erase and insert members. * include/debug/unordered_set: Likewise. * include/profile/unordered_map: Likewise. * include/profile/unordered_set: Likewise. * testsuite/util/exception/safety.h: Fix for the updated erase and insert member functions of the unordered_containers. * testsuite/23_containers/unordered_map/erase/1.cc: New. * testsuite/23_containers/unordered_map/erase/24061-map.cc: Likewise. * testsuite/23_containers/unordered_map/insert/map_single.cc: Likewise. * testsuite/23_containers/unordered_map/insert/array_syntax.cc: Likewise. * testsuite/23_containers/unordered_map/insert/24061-map.cc: Likewise. * testsuite/23_containers/unordered_map/insert/map_range.cc: Likewise. * testsuite/23_containers/set/operators/1_neg.cc: Likewise. * testsuite/23_containers/unordered_multimap/erase/1.cc: Likewise. * testsuite/23_containers/unordered_multimap/erase/ 24061-multimap.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ 24061-multimap.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ multimap_range.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ multimap_single.cc: Likewise. * testsuite/23_containers/unordered_set/erase/1.cc: Likewise. * testsuite/23_containers/unordered_set/erase/24061-set.cc: Likewise. * testsuite/23_containers/unordered_set/insert/set_single.cc: Likewise. * testsuite/23_containers/unordered_set/insert/24061-set.cc: Likewise. * testsuite/23_containers/unordered_set/insert/set_range.cc: Likewise. * testsuite/23_containers/unordered_multiset/erase/1.cc: Likewise. * testsuite/23_containers/unordered_multiset/erase/ 24061-multiset.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ 24061-multiset.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ multiset_range.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ multiset_single.cc: Likewise. * testsuite/23_containers/set/operators/1_neg.cc: Tweak dg-errors to avoid spurious fails in debug-mode. * testsuite/23_containers/map/operators/1_neg.cc: Likewise. From-SVN: r156661
2010-02-10 17:09:42 +01:00
}
void
swap(unordered_multimap& __x)
noexcept( noexcept(__x._M_base().swap(__x)) )
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
{
_Base::swap(__x._M_base());
this->_M_swap(__x);
}
void
rehash(size_type __n)
{
size_type __old_size = _Base::bucket_count();
_Base::rehash(__n);
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_resize(__old_size);
}
};
hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use. 2010-02-10 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use. * include/bits/hashtable_policy.h: New, copy and adjust for C++0x use, include/tr1_impl/hashtable_policy.h; fix erase and insert member functions per n3000. * include/bits/unordered_map.h: Likewise for include/tr1_impl/ unordered_map. * include/bits/unordered_set.h: Likewise for include/tr1_impl/ unordered_set. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/tr1/unordered_map: Adjust. * include/tr1/unordered_set: Likewise. * include/tr1_impl/unordered_map: Adjust, now used only by tr1. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/std/unordered_map: Adjust and simplify includes. * include/std/unordered_set: Likewise. * include/debug/unordered_map: Adjuse erase and insert members. * include/debug/unordered_set: Likewise. * include/profile/unordered_map: Likewise. * include/profile/unordered_set: Likewise. * testsuite/util/exception/safety.h: Fix for the updated erase and insert member functions of the unordered_containers. * testsuite/23_containers/unordered_map/erase/1.cc: New. * testsuite/23_containers/unordered_map/erase/24061-map.cc: Likewise. * testsuite/23_containers/unordered_map/insert/map_single.cc: Likewise. * testsuite/23_containers/unordered_map/insert/array_syntax.cc: Likewise. * testsuite/23_containers/unordered_map/insert/24061-map.cc: Likewise. * testsuite/23_containers/unordered_map/insert/map_range.cc: Likewise. * testsuite/23_containers/set/operators/1_neg.cc: Likewise. * testsuite/23_containers/unordered_multimap/erase/1.cc: Likewise. * testsuite/23_containers/unordered_multimap/erase/ 24061-multimap.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ 24061-multimap.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ multimap_range.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ multimap_single.cc: Likewise. * testsuite/23_containers/unordered_set/erase/1.cc: Likewise. * testsuite/23_containers/unordered_set/erase/24061-set.cc: Likewise. * testsuite/23_containers/unordered_set/insert/set_single.cc: Likewise. * testsuite/23_containers/unordered_set/insert/24061-set.cc: Likewise. * testsuite/23_containers/unordered_set/insert/set_range.cc: Likewise. * testsuite/23_containers/unordered_multiset/erase/1.cc: Likewise. * testsuite/23_containers/unordered_multiset/erase/ 24061-multiset.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ 24061-multiset.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ multiset_range.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ multiset_single.cc: Likewise. * testsuite/23_containers/set/operators/1_neg.cc: Tweak dg-errors to avoid spurious fails in debug-mode. * testsuite/23_containers/map/operators/1_neg.cc: Likewise. From-SVN: r156661
2010-02-10 17:09:42 +01:00
template<typename _Key, typename _Tp, typename _Hash,
hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use. 2010-02-10 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use. * include/bits/hashtable_policy.h: New, copy and adjust for C++0x use, include/tr1_impl/hashtable_policy.h; fix erase and insert member functions per n3000. * include/bits/unordered_map.h: Likewise for include/tr1_impl/ unordered_map. * include/bits/unordered_set.h: Likewise for include/tr1_impl/ unordered_set. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/tr1/unordered_map: Adjust. * include/tr1/unordered_set: Likewise. * include/tr1_impl/unordered_map: Adjust, now used only by tr1. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/std/unordered_map: Adjust and simplify includes. * include/std/unordered_set: Likewise. * include/debug/unordered_map: Adjuse erase and insert members. * include/debug/unordered_set: Likewise. * include/profile/unordered_map: Likewise. * include/profile/unordered_set: Likewise. * testsuite/util/exception/safety.h: Fix for the updated erase and insert member functions of the unordered_containers. * testsuite/23_containers/unordered_map/erase/1.cc: New. * testsuite/23_containers/unordered_map/erase/24061-map.cc: Likewise. * testsuite/23_containers/unordered_map/insert/map_single.cc: Likewise. * testsuite/23_containers/unordered_map/insert/array_syntax.cc: Likewise. * testsuite/23_containers/unordered_map/insert/24061-map.cc: Likewise. * testsuite/23_containers/unordered_map/insert/map_range.cc: Likewise. * testsuite/23_containers/set/operators/1_neg.cc: Likewise. * testsuite/23_containers/unordered_multimap/erase/1.cc: Likewise. * testsuite/23_containers/unordered_multimap/erase/ 24061-multimap.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ 24061-multimap.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ multimap_range.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ multimap_single.cc: Likewise. * testsuite/23_containers/unordered_set/erase/1.cc: Likewise. * testsuite/23_containers/unordered_set/erase/24061-set.cc: Likewise. * testsuite/23_containers/unordered_set/insert/set_single.cc: Likewise. * testsuite/23_containers/unordered_set/insert/24061-set.cc: Likewise. * testsuite/23_containers/unordered_set/insert/set_range.cc: Likewise. * testsuite/23_containers/unordered_multiset/erase/1.cc: Likewise. * testsuite/23_containers/unordered_multiset/erase/ 24061-multiset.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ 24061-multiset.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ multiset_range.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ multiset_single.cc: Likewise. * testsuite/23_containers/set/operators/1_neg.cc: Tweak dg-errors to avoid spurious fails in debug-mode. * testsuite/23_containers/map/operators/1_neg.cc: Likewise. From-SVN: r156661
2010-02-10 17:09:42 +01:00
typename _Pred, typename _Alloc>
inline void
swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use. 2010-02-10 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/hashtable.h: Fold in include/tr1_impl/hashtable.h for C++0x use. * include/bits/hashtable_policy.h: New, copy and adjust for C++0x use, include/tr1_impl/hashtable_policy.h; fix erase and insert member functions per n3000. * include/bits/unordered_map.h: Likewise for include/tr1_impl/ unordered_map. * include/bits/unordered_set.h: Likewise for include/tr1_impl/ unordered_set. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/tr1/unordered_map: Adjust. * include/tr1/unordered_set: Likewise. * include/tr1_impl/unordered_map: Adjust, now used only by tr1. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/std/unordered_map: Adjust and simplify includes. * include/std/unordered_set: Likewise. * include/debug/unordered_map: Adjuse erase and insert members. * include/debug/unordered_set: Likewise. * include/profile/unordered_map: Likewise. * include/profile/unordered_set: Likewise. * testsuite/util/exception/safety.h: Fix for the updated erase and insert member functions of the unordered_containers. * testsuite/23_containers/unordered_map/erase/1.cc: New. * testsuite/23_containers/unordered_map/erase/24061-map.cc: Likewise. * testsuite/23_containers/unordered_map/insert/map_single.cc: Likewise. * testsuite/23_containers/unordered_map/insert/array_syntax.cc: Likewise. * testsuite/23_containers/unordered_map/insert/24061-map.cc: Likewise. * testsuite/23_containers/unordered_map/insert/map_range.cc: Likewise. * testsuite/23_containers/set/operators/1_neg.cc: Likewise. * testsuite/23_containers/unordered_multimap/erase/1.cc: Likewise. * testsuite/23_containers/unordered_multimap/erase/ 24061-multimap.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ 24061-multimap.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ multimap_range.cc: Likewise. * testsuite/23_containers/unordered_multimap/insert/ multimap_single.cc: Likewise. * testsuite/23_containers/unordered_set/erase/1.cc: Likewise. * testsuite/23_containers/unordered_set/erase/24061-set.cc: Likewise. * testsuite/23_containers/unordered_set/insert/set_single.cc: Likewise. * testsuite/23_containers/unordered_set/insert/24061-set.cc: Likewise. * testsuite/23_containers/unordered_set/insert/set_range.cc: Likewise. * testsuite/23_containers/unordered_multiset/erase/1.cc: Likewise. * testsuite/23_containers/unordered_multiset/erase/ 24061-multiset.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ 24061-multiset.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ multiset_range.cc: Likewise. * testsuite/23_containers/unordered_multiset/insert/ multiset_single.cc: Likewise. * testsuite/23_containers/set/operators/1_neg.cc: Tweak dg-errors to avoid spurious fails in debug-mode. * testsuite/23_containers/map/operators/1_neg.cc: Likewise. From-SVN: r156661
2010-02-10 17:09:42 +01:00
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
c++config (_GLIBCXX_NOEXCEPT_IF): Define. * include/bits/c++config (_GLIBCXX_NOEXCEPT_IF): Define. * include/bits/forward_list.h (forward_list::swap): Make noexcept unconditional. * include/bits/hashtable.h (_Hashtable::swap): Do not use _S_nothrow_swap(). * include/bits/stl_bvector.h (vector<bool>::swap): Make noexcept unconditional. * include/bits/stl_deque.h (deque::swap): Likewise. (swap(deque&, deque&)): Use _GLIBCXX_NOEXCEPT_IF. * include/bits/stl_list.h (list::swap): Make noexcept unconditional. (swap(list&, list&)): Use _GLIBCXX_NOEXCEPT_IF. * include/bits/stl_map.h (map::swap, swap(map&, map&)): Use _GLIBCXX_NOEXCEPT_IF, do not depend on _S_nothrow_swap. * include/bits/stl_multimap.h (multimap::swap, swap(multimap&, multimap&)): Likewise. * include/bits/stl_multiset.h (multiset::swap, swap(multiset&, multiset&)): Likewise. * include/bits/stl_set.h (set::swap, swap(set&, set&)): Likewise. * include/bits/stl_tree.h (_Rb_tree::swap, swap(_Rb_tree&, _Rb_tree&)): Likewise. * include/bits/stl_vector.h (vector::swap): Make noexcept unconditional. (swap(vector&, vector&)): Use _GLIBCXX_NOEXCEPT_IF. * include/debug/deque (deque::swap, swap): Likewise. * include/debug/forward_list (swap): Add noexcept. * include/debug/list (list::swap, swap): Use _GLIBCXX_NOEXCEPT_IF. * include/debug/map.h (map::swap, swap): Likewise. * include/debug/multimap.h (multimap::swap, swap): Likewise. * include/debug/multiset.h (multiset::Swap, swap): Likewise. * include/debug/set.h (set::swap, swap): Likewise. * include/debug/unordered_map (unordered_map::swap, unordered_multimap::swap, swap): Likewise. * include/debug/unordered_set (unordered_set::swap, unordered_multiset::swap, swap): Likewise. * include/debug/vector (vector::swap, swap): Likewise. * include/ext/alloc_traits.h (__alloc_traits::_S_nothrow_swap()): Remove. * include/profile/deque (deque::swap, swap): Use _GLIBCXX_NOEXCEPT_IF. * include/profile/forward_list (swap): Add noexcept. * include/profile/list (list::swap, swap) : Use _GLIBCXX_NOEXCEPT_IF. * include/profile/map.h (map::swap, swap): Likewise. * include/profile/multimap.h (multimap::swap, swap): Likewise. * include/profile/multiset.h (multiset::swap, swap): Likewise. * include/profile/set.h (set::swap, swap): Likewise. * include/profile/unordered_map (swap): Likewise. * include/profile/unordered_set (swap): Likewise. * include/profile/vector (vector::swap, swap): Likewise. Remove overloads for swapping rvalues. * testsuite/23_containers/deque/allocator/noexcept.cc: Update tests for noexcept on swap. * testsuite/23_containers/forward_list/allocator/noexcept.cc: Likewise. * testsuite/23_containers/list/allocator/noexcept.cc: Likewise. * testsuite/23_containers/map/allocator/noexcept.cc: Likewise. * testsuite/23_containers/multimap/allocator/noexcept.cc: Likewise. * testsuite/23_containers/multiset/allocator/noexcept.cc: Likewise. * testsuite/23_containers/set/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/noexcept.cc: Likewise. * testsuite/23_containers/vector/allocator/noexcept.cc: Likewise. * testsuite/23_containers/vector/bool/allocator/noexcept.cc: Likewise. * testsuite/ext/profile/mutex_extensions_neg.cc: Adjust dg-error line number. From-SVN: r225744
2015-07-13 19:15:48 +02:00
noexcept(noexcept(__x.swap(__y)))
{ __x.swap(__y); }
template<typename _Key, typename _Tp, typename _Hash,
typename _Pred, typename _Alloc>
inline bool
operator==(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return static_cast<const _GLIBCXX_STD_BASE&>(__x) == __y; }
template<typename _Key, typename _Tp, typename _Hash,
typename _Pred, typename _Alloc>
inline bool
operator!=(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ return !(__x == __y); }
} // namespace __profile
} // namespace std
#undef _GLIBCXX_BASE
#undef _GLIBCXX_STD_BASE
#endif // C++11
#endif