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

490 lines
14 KiB
Plaintext
Raw Normal View History

// Profiling unordered_set/unordered_multiset implementation -*- C++ -*-
// Copyright (C) 2009-2015 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_set
* This file is a GNU profile extension to the Standard C++ Library.
*/
#ifndef _GLIBCXX_PROFILE_UNORDERED_SET
#define _GLIBCXX_PROFILE_UNORDERED_SET 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_set>
#include <profile/base.h>
#include <profile/unordered_base.h>
#define _GLIBCXX_BASE unordered_set<_Key, _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
{
/** @brief Unordered_set wrapper with performance instrumentation. */
template<typename _Key,
typename _Hash = std::hash<_Key>,
typename _Pred = std::equal_to<_Key>,
typename _Alloc = std::allocator<_Key> >
class unordered_set
: public _GLIBCXX_STD_BASE,
public _Unordered_profile<unordered_set<_Key, _Hash, _Pred, _Alloc>,
true>
{
typedef _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_set() = 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_set(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_set(_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_set(const unordered_set&) = default;
unordered_set(const _Base& __x)
: _Base(__x)
{ }
unordered_set(unordered_set&&) = default;
explicit
unordered_set(const allocator_type& __a)
: _Base(__a)
{ }
unordered_set(const unordered_set& __uset,
const allocator_type& __a)
: _Base(__uset._M_base(), __a)
{ }
unordered_set(unordered_set&& __uset,
const allocator_type& __a)
: _Base(std::move(__uset._M_base()), __a)
{ }
unordered_set(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_set&
operator=(const unordered_set&) = default;
unordered_set&
operator=(unordered_set&&) = default;
unordered_set&
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
swap(unordered_set& __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);
this->_M_swap(__x);
}
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
std::pair<iterator, bool>
insert(value_type&& __obj)
{
size_type __old_size = _Base::bucket_count();
std::pair<iterator, bool> __res = _Base::insert(std::move(__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;
2010-10-28 18:01:05 +02:00
}
iterator
insert(const_iterator __iter, value_type&& __v)
{
size_type __old_size = _Base::bucket_count();
iterator __res = _Base::insert(__iter, std::move(__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 _InputIter>
void
insert(_InputIter __first, _InputIter __last)
{
size_type __old_size = _Base::bucket_count();
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
_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
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 _Hash, typename _Pred, typename _Alloc>
inline void
swap(unordered_set<_Key, _Hash, _Pred, _Alloc>& __x,
unordered_set<_Key, _Hash, _Pred, _Alloc>& __y)
{ __x.swap(__y); }
template<typename _Key, typename _Hash, typename _Pred, typename _Alloc>
inline bool
operator==(const unordered_set<_Key, _Hash, _Pred, _Alloc>& __x,
const unordered_set<_Key, _Hash, _Pred, _Alloc>& __y)
{ return static_cast<const _GLIBCXX_STD_BASE&>(__x) == __y; }
template<typename _Key, typename _Hash, typename _Pred, typename _Alloc>
inline bool
operator!=(const unordered_set<_Key, _Hash, _Pred, _Alloc>& __x,
const unordered_set<_Key, _Hash, _Pred, _Alloc>& __y)
{ return !(__x == __y); }
#undef _GLIBCXX_BASE
#undef _GLIBCXX_STD_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
#define _GLIBCXX_STD_BASE _GLIBCXX_STD_C::_GLIBCXX_BASE
#define _GLIBCXX_BASE unordered_multiset<_Value, _Hash, _Pred, _Alloc>
/** @brief Unordered_multiset wrapper with performance instrumentation. */
template<typename _Value,
typename _Hash = std::hash<_Value>,
typename _Pred = std::equal_to<_Value>,
typename _Alloc = std::allocator<_Value> >
class unordered_multiset
: public _GLIBCXX_STD_BASE,
public _Unordered_profile<unordered_multiset<_Value,
_Hash, _Pred, _Alloc>,
false>
{
typedef _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_multiset() = 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_multiset(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_multiset(_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_multiset(const unordered_multiset&) = default;
unordered_multiset(const _Base& __x)
: _Base(__x)
{ }
unordered_multiset(unordered_multiset&&) = default;
explicit
unordered_multiset(const allocator_type& __a)
: _Base(__a)
{ }
unordered_multiset(const unordered_multiset& __umset,
const allocator_type& __a)
: _Base(__umset._M_base(), __a)
{ }
unordered_multiset(unordered_multiset&& __umset,
const allocator_type& __a)
: _Base(std::move(__umset._M_base()), __a)
{ }
unordered_multiset(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_multiset&
operator=(const unordered_multiset&) = default;
unordered_multiset&
operator=(unordered_multiset&&) = default;
unordered_multiset&
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
swap(unordered_multiset& __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);
this->_M_swap(__x);
}
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)
2010-10-28 18:01:05 +02:00
{
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
iterator
insert(value_type&& __obj)
{
size_type __old_size = _Base::bucket_count();
iterator __res = _Base::insert(std::move(__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;
2010-10-28 18:01:05 +02:00
}
iterator
insert(const_iterator __iter, value_type&& __v)
{
size_type __old_size = _Base::bucket_count();
iterator __res = _Base::insert(__iter, std::move(__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 _InputIter>
void
insert(_InputIter __first, _InputIter __last)
{
size_type __old_size = _Base::bucket_count();
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
_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
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 _Value, typename _Hash, typename _Pred, typename _Alloc>
inline void
swap(unordered_multiset<_Value, _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_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
{ __x.swap(__y); }
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
inline bool
operator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
{ return static_cast<const _GLIBCXX_STD_BASE&>(__x) == __y; }
template<typename _Value, typename _Hash, typename _Pred, typename _Alloc>
inline bool
operator!=(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
{ return !(__x == __y); }
} // namespace __profile
} // namespace std
#undef _GLIBCXX_BASE
#undef _GLIBCXX_STD_BASE
#endif // C++11
#endif