gcc/libstdc++-v3/testsuite/util/testsuite_allocator.h

525 lines
14 KiB
C
Raw Normal View History

Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
// -*- C++ -*-
// Testing allocator for the C++ library testsuite.
//
// Copyright (C) 2002-2014 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.
//
// 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/>.
//
// This file provides an test instrumentation allocator that can be
// used to verify allocation functionality of standard library
// containers. 2002.11.25 smw
#ifndef _GLIBCXX_TESTSUITE_ALLOCATOR_H
#define _GLIBCXX_TESTSUITE_ALLOCATOR_H
#include <tr1/unordered_map>
#include <bits/move.h>
#include <ext/pointer.h>
#include <testsuite_hooks.h>
namespace __gnu_test
{
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
class tracker_allocator_counter
{
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
public:
typedef std::size_t size_type;
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
static void*
allocate(size_type blocksize)
{
void* p = ::operator new(blocksize);
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
allocationCount_ += blocksize;
return p;
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
}
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
static void
construct() { constructCount_++; }
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
static void
destroy() { destructCount_++; }
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
static void
deallocate(void* p, size_type blocksize)
{
::operator delete(p);
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
deallocationCount_ += blocksize;
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
}
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
static size_type
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
get_allocation_count() { return allocationCount_; }
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
static size_type
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
get_deallocation_count() { return deallocationCount_; }
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
static int
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
get_construct_count() { return constructCount_; }
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
static int
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
get_destruct_count() { return destructCount_; }
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
static void
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
reset()
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
{
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
allocationCount_ = 0;
deallocationCount_ = 0;
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
constructCount_ = 0;
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
destructCount_ = 0;
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
}
private:
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
static size_type allocationCount_;
static size_type deallocationCount_;
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
static int constructCount_;
static int destructCount_;
};
// A simple basic allocator that just forwards to the
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
// tracker_allocator_counter to fulfill memory requests. This class
// is templated on the target object type, but tracker isn't.
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
template<class T>
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
class tracker_allocator
{
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
private:
typedef tracker_allocator_counter counter_type;
public:
typedef T value_type;
typedef T* pointer;
typedef const T* const_pointer;
typedef T& reference;
typedef const T& const_reference;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
template<class U> struct rebind { typedef tracker_allocator<U> other; };
pointer
address(reference value) const _GLIBCXX_NOEXCEPT
{ return std::__addressof(value); }
const_pointer
address(const_reference value) const _GLIBCXX_NOEXCEPT
{ return std::__addressof(value); }
tracker_allocator() _GLIBCXX_USE_NOEXCEPT
{ }
tracker_allocator(const tracker_allocator&) _GLIBCXX_USE_NOEXCEPT
{ }
template<class U>
tracker_allocator(const tracker_allocator<U>&) _GLIBCXX_USE_NOEXCEPT
{ }
~tracker_allocator() _GLIBCXX_USE_NOEXCEPT
{ }
size_type
max_size() const _GLIBCXX_USE_NOEXCEPT
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
{ return size_type(-1) / sizeof(T); }
pointer
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
allocate(size_type n, const void* = 0)
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
{ return static_cast<pointer>(counter_type::allocate(n * sizeof(T))); }
#if __cplusplus >= 201103L
template<typename U, typename... Args>
void
construct(U* p, Args&&... args)
{
::new((void *)p) U(std::forward<Args>(args)...);
counter_type::construct();
}
template<typename U>
void
destroy(U* p)
{
p->~U();
counter_type::destroy();
}
#else
void
construct(pointer p, const T& value)
{
throw_allocator.h (throw_allocator<>:: construct<>(pointer, _Args&&...)): Add. 2007-10-26 Paolo Carlini <pcarlini@suse.de> * include/ext/throw_allocator.h (throw_allocator<>:: construct<>(pointer, _Args&&...)): Add. * include/ext/pool_allocator.h (__pool_alloc<>:: construct<>(pointer, _Args&&...)): Likewise. (construct(pointer, const _Tp&)): Cast pointer to void*. * include/ext/bitmap_allocator.h (bitmap_allocator<>:: construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. * include/ext/new_allocator.h (new_allocator<>:: construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. * include/ext/malloc_allocator.h (malloc_allocator<>:: construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. * include/ext/array_allocator.h (array_allocator<>:: construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. * include/ext/mt_allocator.h (__mt_alloc<>:: construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. * testsuite/util/testsuite_allocator.h (tracker_allocator<>:: construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. (uneq_allocator<>::construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. * testsuite/ext/mt_allocator/variadic_construct.cc: New. * testsuite/ext/new_allocator/variadic_construct.cc: Likewise. * testsuite/ext/throw_allocator/variadic_construct.cc: Likewise. * testsuite/ext/malloc_allocator/variadic_construct.cc: Likewise. * testsuite/ext/pool_allocator/variadic_construct.cc: Likewise. * testsuite/ext/bitmap_allocator/variadic_construct.cc: Likewise. * testsuite/ext/array_allocator/variadic_construct.cc: Likewise. From-SVN: r129672
2007-10-27 02:41:21 +02:00
::new ((void *)p) T(value);
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
counter_type::construct();
}
void
destroy(pointer p)
{
p->~T();
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
counter_type::destroy();
}
#endif
void
deallocate(pointer p, size_type num)
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
{ counter_type::deallocate(p, num * sizeof(T)); }
};
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
template<class T1, class T2>
bool
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
operator==(const tracker_allocator<T1>&,
const tracker_allocator<T2>&) throw()
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
{ return true; }
template<class T1, class T2>
bool
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
operator!=(const tracker_allocator<T1>&,
const tracker_allocator<T2>&) throw()
Renames, namespaces for testsuite utilities. 2003-01-12 Benjamin Kosnik <bkoz@redhat.com> Renames, namespaces for testsuite utilities. * testsuite/testsuite_hooks.h: Put into namespace __gnu_cxx_test. (gnu_allocator_tracker): Rename to allocation_tracker. (gnu_new_allocator): Rename to tracker_alloc. (__set_testsuite_memlimit): Rename to set_memory_limits. (gnu_assignment_operator): Rename to assignment_operator. (gnu_destructor): Rename to destructor. (gnu_copy_tracker): Rename to copy_tracker. (gnu_char, gnu_int, gnu_long): Rename to pod_char, pod_int, pod_long. (run_tests_wrapped_locale): New. (run_tests_wrapped_env): New. * testsuite/testsuite_hooks.cc: Same. (class locale_data): Add. (class enviornment_variable): Add. (class not_found): Add. * testsuite/testsuite_allocator.h: Same. * testsuite/testsuite_allocator.cc: Same. * testsuite/23_containers/deque_ctor.cc (test_copy_ctor_exception_safety): Change gnu_allocator_tracker to allocation_tracker. Change gnu_new_allocator to tracker_alloc. Change gnu_counting_struct to counter. Change gnu_copy_tracker to copy_tracker. Change gnu_copy_constructor to copy_constructor. Change gnu_assignment_operator to assignment_operator. Inject. * testsuite/23_containers/vector_capacity.cc: Same. * testsuite/23_containers/vector_ctor.cc (test01): Same. * testsuite/23_containers/list_modifiers.cc: Change gnu_copy_tracker to copy_tracker. * testsuite/21_strings/ctor_copy_dtor.cc (main): Change __set_testsuite_memlimit to set_memory_limits. * testsuite/21_strings/insert.cc (main): Same. * testsuite/27_io/filebuf.cc: Change gnu_char to pod_char. * testsuite/27_io/stringstream.cc: Same. * testsuite/27_io/stringbuf.cc: Same. * testsuite/27_io/streambuf.cc: Same. * testsuite/27_io/ostream.cc: Same. * testsuite/27_io/istream.cc: Same. * testsuite/27_io/fstream.cc: Same. * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-list-sourcefiles): Additionally handle files two and three levels deeper in glob patterns. From-SVN: r61261
2003-01-14 05:56:56 +01:00
{ return false; }
stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. * include/bits/stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. Another inline three-argument overload that takes std::allocator and dispatches to the two-argument version. * include/bits/stl_uninitialized.h (__uninitialized_fill_n_aux): Change return type to void to match uninitialized_fill_n. (__uninitialized_copy_a_): New function. Like uninitialized_copy except that it takes an allocator and uses it for construct and destroy. If the allocator is std::allocator, dispatches to uninitialized_copy. (__uninitialized_fill_a): Likewise. (__uninitialized_fill_n_a): Likewise. (__uninitialized_copy_copy): Give it an allocator argument. (__uninitialized_fill_copy): Likewise. (__uninitialized_copy_fill): Likewise. * include/bits/deque.tcc: Use new forms defined in stl_construct.h and stl_uninitialized.h. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/bits/list.tcc: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/hashtable.h: Use rebind so that allocator_type has correct type for a container's allocator. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/ext/memory (__uninitialized_copy_n_a): New function. Like uninitialized_copy_n except that it takes an extra parameter, an allocator, and uses it for construct and destroy operations. * include/ext/rope: Use new forms defined in stl_construct.h, stl_uninitialized.h, and ext/memory. Replace use of single-argument _Construct and _Destroy with allocator construct and destroy methods. * include/ext/ropeimpl.h: Likewise. * include/ext/slist.h: Likewise. * testsuite/testsuite_allocator.h (check_construct_destroy): New. * testsuite/testsuite_allocator.cc (check_construct_destroy): New. * testsuite/23_containers/deque/check_construct_destroy.cc: New. * testsuite/23_containers/list/check_construct_destroy.cc: New. * testsuite/23_containers/set/check_construct_destroy.cc: New. * testsuite/23_containers/vector/check_construct_destroy.cc: New. * testsuite/ext/hash_check_construct_destroy.cc: New. * testsuite/ext/slist_check_construct_destroy.cc: New. From-SVN: r85265
2004-07-28 18:37:20 +02:00
re PR libstdc++/16614 (Excessive resource usage in __mt_alloc) 2004-09-01 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/16614 * include/ext/mt_allocator.h (__mt_base): Not type dependent, split into.. (__pool): New, specialize. (__common_pool): New, static bits here. (__per_type_pool): New, and here. (__mt_alloc_base): New. (__mt_alloc): Add template parameter, inherit from it. * src/allocator.cc: Split this... * src/allocator-inst.cc: And this... * src/pool_allocator.cc: ...into this. * src/mt_allocator.cc: ... and this. Add definitions for __mt_base. * src/Makefile.am (sources): Split allocator.cc to pool_allocator.cc and mt_allocator.cc. * src/Makefile.in: Regenerate. * config/linker-map.gnu: Add symbols. * docs/html/ext/mt_allocator.html: Document new design. * testsuite/ext/mt_allocator/tune-1.cc: New. * testsuite/ext/mt_allocator/tune-2.cc: New. * testsuite/ext/mt_allocator/tune-3.cc: New. * testsuite/ext/mt_allocator/tune-4.cc: New. * testsuite/testsuite_allocator.h (__gnu_test::check_new): New. * testsuite/ext/allocators.cc: Use check_new, split into... * testsuite/ext/mt_allocator/check_new.cc: this. * testsuite/ext/pool_allocator/check_new.cc: this. * testsuite/ext/malloc_allocator/check_new.cc: this. * testsuite/ext/debug_allocator/check_new.cc: this. * testsuite/ext/mt_allocator/instantiate.cc: this. * testsuite/ext/pool_allocator/instantiate.cc: this. * testsuite/ext/malloc_allocator/instantiate.cc: this. * testsuite/ext/debug_allocator/instantiate.cc: this. From-SVN: r86936
2004-09-02 00:17:00 +02:00
bool
check_construct_destroy(const char* tag, int expected_c, int expected_d);
stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. * include/bits/stl_construct.h (_Destroy): New three-argument overload that takes an allocator argument. Another inline three-argument overload that takes std::allocator and dispatches to the two-argument version. * include/bits/stl_uninitialized.h (__uninitialized_fill_n_aux): Change return type to void to match uninitialized_fill_n. (__uninitialized_copy_a_): New function. Like uninitialized_copy except that it takes an allocator and uses it for construct and destroy. If the allocator is std::allocator, dispatches to uninitialized_copy. (__uninitialized_fill_a): Likewise. (__uninitialized_fill_n_a): Likewise. (__uninitialized_copy_copy): Give it an allocator argument. (__uninitialized_fill_copy): Likewise. (__uninitialized_copy_fill): Likewise. * include/bits/deque.tcc: Use new forms defined in stl_construct.h and stl_uninitialized.h. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/bits/list.tcc: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_tree.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/vector.tcc: Likewise. * include/ext/hashtable.h: Use rebind so that allocator_type has correct type for a container's allocator. Replace use of single-argument _Construct and _Destroy with use of allocator's construct and destroy methods. * include/ext/memory (__uninitialized_copy_n_a): New function. Like uninitialized_copy_n except that it takes an extra parameter, an allocator, and uses it for construct and destroy operations. * include/ext/rope: Use new forms defined in stl_construct.h, stl_uninitialized.h, and ext/memory. Replace use of single-argument _Construct and _Destroy with allocator construct and destroy methods. * include/ext/ropeimpl.h: Likewise. * include/ext/slist.h: Likewise. * testsuite/testsuite_allocator.h (check_construct_destroy): New. * testsuite/testsuite_allocator.cc (check_construct_destroy): New. * testsuite/23_containers/deque/check_construct_destroy.cc: New. * testsuite/23_containers/list/check_construct_destroy.cc: New. * testsuite/23_containers/set/check_construct_destroy.cc: New. * testsuite/23_containers/vector/check_construct_destroy.cc: New. * testsuite/ext/hash_check_construct_destroy.cc: New. * testsuite/ext/slist_check_construct_destroy.cc: New. From-SVN: r85265
2004-07-28 18:37:20 +02:00
template<typename Alloc>
bool
check_deallocate_null()
{
// Let's not core here...
Alloc a;
c++config (std::size_t, [...]): Provide typedefs. 2010-06-03 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/c++config (std::size_t, std::ptrdiff_t, std::nullptr_t): Provide typedefs. * include/c_std/cstddef: Don't provide std::size_t and std::ptrdiff_t here. * include/c_global/cstddef: Likewise. * src/condition_variable.cc: Don't include <cstddef>, don't use NULL, use std::size_t and std::ptrdiff_t. * src/mt_allocator.cc: Likewise. * src/localename.cc: Likewise. * src/chrono.cc: Likewise. * src/thread.cc: Likewise. * include/debug/formatter.h: Likewise. * include/debug/functions.h: Likewise. * include/std/valarray: Likewise. * include/std/thread: Likewise. * include/std/type_traits: Likewise. * include/std/atomic: Likewise. * include/std/iterator: Likewise. * include/std/bitset: Likewise. * include/std/fstream: Likewise. * include/std/mutex: Likewise. * include/c_std/cstdlib: Likewise. * include/c_std/cstdio: Likewise. * include/c_std/ctime: Likewise. * include/c_std/cwchar: Likewise. * include/c_std/cstring: Likewise. * include/parallel/multiway_merge.h: Likewise. * include/parallel/multiseq_selection.h: Likewise. * include/parallel/base.h: Likewise. * include/parallel/basic_iterator.h: Likewise. * include/parallel/multiway_mergesort.h * include/parallel/partition.h: Likewise. * include/ext/string_conversions.h: Likewise. * include/ext/pb_ds/assoc_container.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ hash_prime_size_policy_imp.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ sample_resize_policy.hpp: Likewise. * include/ext/pb_ds/detail/resize_policy/ sample_resize_trigger.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/binomial_heap_base_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ erase_store_hash_fn_imps.hpp: Likewise. * include/ext/pb_ds/d: Likewise.etail/cc_hash_table_map_/ insert_no_store_hash_fn_imps.hpp * include/ext/pb_ds/detail/cc_hash_table_map_/ cmp_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ insert_store_hash_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ info_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ entry_list_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ trace_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ cc_ht_map_.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/cc_hash_table_map_/ erase_no_store_hash_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/unordered_iterator/ iterator.hpp: Likewise. * include/ext/pb_ds/detail/unordered_iterator/ const_iterator.hpp: Likewise. * include/ext/pb_ds/detail/unordered_iterator/ point_iterator.hpp: Likewise. * include/ext/pb_ds/detail/unordered_iterator/ const_point_iterator.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/child_iterator.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ insert_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/ const_child_iterator.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/node_iterators.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/internal_node.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/point_iterators.hpp: Likewise. * include/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ r_erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ rotate_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ node_iterators.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ point_iterators.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/bin_search_tree_/ iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ gp_ht_map_.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/gp_hash_table_map_/ standard_policies.hpp: Likewise. * include/ext/pb_ds/detail/tree_policy/ sample_tree_node_update.hpp: Likewise. * include/ext/pb_ds/detail/basic_tree_policy/ null_node_metadata.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/const_iterator.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ const_point_iterator.hpp: Likewise. * include/ext/pb_ds/detail/binary_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/trie_policy/ sample_trie_node_update.hpp: Likewise. * include/ext/pb_ds/detail/trie_policy/ sample_trie_e_access_traits.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/pairing_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_policy/ counter_lu_metadata.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ trace_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ null_metadata.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ const_iterator.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ const_point_iterator.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/thin_heap_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/ constructors_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp: Likewise. * include/ext/pb_ds/detail/ov_tree_map_/ iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp: Likewise. * include/ext/pb_ds/detail/hash_fn/ sample_ranged_probe_fn.hpp: Likewise. * include/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp: Likewise. * include/ext/pb_ds/detail/hash_fn/ sample_ranged_hash_fn.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/splay_tree_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ trace_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ find_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ info_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/list_update_map_/ iterators_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rc_binomial_heap_/ erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rc_binomial_heap_/ insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rc_binomial_heap_/ debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/ split_join_fn_imps.hpp: Likewise. * include/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp: Likewise. * include/ext/pb_ds/list_update_policy.hpp: Likewise. * include/ext/pb_ds/exception.hpp: Likewise. * include/ext/pb_ds/tree_policy.hpp: Likewise. * include/ext/pb_ds/tag_and_trait.hpp: Likewise. * include/ext/pb_ds/hash_policy.hpp: Likewise. * include/ext/pb_ds/trie_policy.hpp: Likewise. * include/ext/pb_ds/priority_queue.hpp: Likewise. * include/ext/throw_allocator.h: Likewis: Likewise.e. * include/ext/bitmap_allocator.h * include/ext/rc_string_base.h: Likewise. * include/ext/new_allocator.h: Likewise. * include/ext/codecvt_specializations.h: Likewise. * include/ext/functional: Likewise.: Likewise. * include/ext/array_allocator.h: Likewise. * include/ext/mt_allocator.h: Likewise. * include/ext/sso_string_base.h: Likewise. * include/profile/impl/profiler_trace.h: Likewise. * include/profile/impl/profiler_node.h: Likewise. * include/bits/stl_algobase.h: Likewise. * include/bits/functional_hash.h: Likewise. * include/bits/locale_facets.tcc: Likewise. * include/bits/locale_facets.h: Likewise. * include/bits/stl_iterator_base_types.h: Likewise. * include/bits/move.h: Likewise. * include/bits/boost_concept_check.h: Likewise. * include/bits/basic_string.tcc: Likewise. * include/bits/locale_facets_nonio.tcc: Likewise. * include/bits/fstream.tcc: Likewise. * include/bits/locale_facets_nonio.h: Likewise. * include/c_global/cstdlib: Likewise. * include/c_global/cstdio: Likewise. * include/c_global/ctime: Likewise. * include/c_global/cwchar: Likewise. * include/c_global/cstring * include/tr1/type_traits: Likewise. * include/backward/hash_fun.h: Likewise. * libsupc++/new: Likewise. * libsupc++/initializer_list: Likewise. * testsuite/27_io/basic_ofstream/pthread2.cc: Likewise. * testsuite/27_io/basic_iostream/cons/2020.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetn/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetn/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/overflow/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/overflow/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetc/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sgetc/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/char/1057.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sputc/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_streambuf/sputc/char/1057.cc: Likewise. * testsuite/27_io/objects/wchar_t/5268.cc: Likewise. * testsuite/27_io/objects/char/9661-1.cc: Likewise. * testsuite/27_io/objects/char/5268.cc: Likewise. * testsuite/27_io/objects/char/10.cc: Likewise. * testsuite/27_io/basic_ios/copyfmt/char/1.cc: Likewise. * testsuite/27_io/basic_ios/copyfmt/char/2.cc: Likewise. * testsuite/27_io/basic_ios/exceptions/char/1.cc: Likewise. * testsuite/27_io/basic_ios/locales/char/1.cc: Likewise. * testsuite/27_io/basic_ios/clear/char/1.cc: Likewise. * testsuite/27_io/basic_ostringstream/pthread3.cc: Likewise. * testsuite/27_io/basic_stringbuf/sputc/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_stringbuf/sputc/char/1057.cc: Likewise. * testsuite/27_io/basic_stringbuf/sputn/wchar_t/1057.cc: Likewise. * testsuite/27_io/basic_stringbuf/sputn/char/1057.cc: Likewise. * testsuite/27_io/basic_istream/get/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/get/char/1.cc: Likewise. * testsuite/27_io/basic_istream/ignore/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/ignore/char/1.cc: Likewise. * testsuite/27_io/basic_istream/peek/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/peek/char/1.cc: Likewise. * testsuite/27_io/basic_istream/getline/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/getline/char/1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_other/wchar_t/ exceptions_null.cc * testsuite/27_io/basic_istream/extractors_other/wchar_t/ 1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_other/char/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_istream/extractors_other/char/1.cc: Likewise. * testsuite/27_io/basic_istream/cons/3.cc: Likewise. * testsuite/27_io/basic_istream/extractors_arithmetic/ wchar_t/01.cc: Likewise. * testsuite/27_io/basic_istream/extractors_arithmetic/ char/01.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ wchar_t/2.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ wchar_t/3.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ char/1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ char/2.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ char/3.cc: Likewise. * testsuite/27_io/basic_istream/extractors_character/ char/9826.cc: Likewise. * testsuite/27_io/basic_istream/read/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_istream/read/char/1.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/wchar_t/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/wchar_t/ 1.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/char/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/char/1.cc: Likewise. * testsuite/27_io/basic_ostream/cons/2020.cc: Likewise. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_character/ wchar_t/8.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_character/ char/8.cc: Likewise. * testsuite/27_io/basic_filebuf/setbuf/char/1.cc: Likewise. * testsuite/27_io/basic_filebuf/sputc/char/1057.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/1.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/2.cc: Likewise. * testsuite/27_io/basic_filebuf/open/char/9507.cc: Likewise. * testsuite/27_io/basic_filebuf/imbue/wchar_t/14975-2.cc: Likewise. * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-1.cc: Likewise. * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-2.cc: Likewise. * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-3.cc: Likewise. * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-4.cc: Likewise. * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/9964.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/1.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/2.cc: Likewise. * testsuite/27_io/basic_filebuf/close/char/12790-3.cc: Likewise. * testsuite/27_io/basic_filebuf/sputn/char/1057.cc: Likewise. * testsuite/24_iterators/ostreambuf_iterator/2.cc: Likewise. * testsuite/18_support/bad_exception/23591_thread-1.c * testsuite/18_support/new_delete_placement.cc: Likewise. * testsuite/18_support/pthread_guard.cc: Likewise. * testsuite/21_strings/basic_string/operations/wchar_t/1.cc: Likewise. * testsuite/21_strings/basic_string/operations/char/1.cc: Likewise. * testsuite/21_strings/basic_string/pthread4.cc: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/5.cc: Likewise. * testsuite/21_strings/basic_string/cons/char/5.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/mutex/cons/assign_neg.cc: Likewise. * testsuite/30_threads/mutex/cons/copy_neg.cc: Likewise. * testsuite/30_threads/thread/cons/assign_neg.cc: Likewise. * testsuite/30_threads/thread/cons/copy_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/ assign_neg.cc: Likewise. * testsuite/30_threads/recursive_timed_mutex/cons/ copy_neg.cc: Likewise. * testsuite/ext/mt_allocator/22309_thread.cc: Likewise. * testsuite/ext/slist/23781.cc: Likewise. * testsuite/ext/rope/pthread7-rope.cc: Likewise. * testsuite/ext/stdio_filebuf/char/10063-2.cc: Likewise. * testsuite/22_locale/ctype/is/wchar_t/1.cc: Likewise. * testsuite/22_locale/ctype/is/char/1.cc: Likewise. * testsuite/22_locale/time_put/put/char/12439_1.cc: Likewise. * testsuite/22_locale/time_put/put/char/12439_3.cc: Likewise. * testsuite/22_locale/locale/cons/2.cc: Likewise. * testsuite/22_locale/locale/cons/12658_thread-1.cc: Likewise. * testsuite/22_locale/locale/cons/29217.cc: Likewise. * testsuite/22_locale/locale/global_locale_objects/14071.cc: Likewise. * testsuite/22_locale/locale/global_locale_objects/2.cc: Likewise. * testsuite/tr1/6_containers/unordered_multimap/ requirements/iterator_null_neg.cc: Likewise. * testsuite/tr1/6_containers/unordered_multiset/ requirements/iterator_null_neg.cc: Likewise. * testsuite/29_atomics/atomic_address/cons/single_value.cc: Likewise. * testsuite/29_atomics/atomic_address/cons/aggregate.cc: Likewise. * testsuite/23_containers/multimap/23781.cc: Likewise. * testsuite/23_containers/set/23781.cc: Likewise. * testsuite/23_containers/multiset/23781.cc: Likewise. * testsuite/23_containers/list/pthread1.cc: Likewise. * testsuite/23_containers/list/23781.cc: Likewise. * testsuite/23_containers/map/pthread6.cc: Likewise. * testsuite/23_containers/map/23781.cc: Likewise. * testsuite/util/regression/rand/priority_queue/ rand_regression_test.hpp: Likewise. * testsuite/util/regression/rand/priority_queue/ container_rand_regression_test.tcc: Likewise. * testsuite/util/regression/rand/assoc/ rand_regression_test.hpp: Likewise. * testsuite/util/regression/rand/assoc/ container_rand_regression_test.tcc: Likewise. * testsuite/util/testsuite_hooks.cc: Likewise. * testsuite/util/testsuite_io.h: Likewise. * testsuite/util/testsuite_iterators.h: Likewise. * testsuite/util/replacement_memory_operators.h: Likewise. * testsuite/util/testsuite_allocator.h: Likewise. * testsuite/util/testsuite_performance.h: Likewise. From-SVN: r160231
2010-06-03 21:15:56 +02:00
a.deallocate(0, 1);
a.deallocate(0, 10);
return true;
}
template<typename Alloc>
bool
check_allocate_max_size()
{
Alloc a;
try
{
a.allocate(a.max_size() + 1);
}
catch(std::bad_alloc&)
{
return true;
}
catch(...)
{
throw;
}
throw;
}
// A simple allocator which can be constructed endowed of a given
// "personality" (an integer), queried in operator== to simulate the
// behavior of realworld "unequal" allocators (i.e., not exploiting
// the provision in 20.1.5/4, first bullet). A global unordered_map,
// filled at allocation time with (pointer, personality) pairs, is
// then consulted to enforce the requirements in Table 32 about
// deallocation vs allocator equality. Note that this allocator is
// swappable, not assignable, consistently with Option 3 of DR 431
// (see N1599).
struct uneq_allocator_base
{
typedef std::tr1::unordered_map<void*, int> map_type;
// Avoid static initialization troubles and/or bad interactions
// with tests linking testsuite_allocator.o and playing globally
// with operator new/delete.
static map_type&
get_map()
{
static map_type alloc_map;
return alloc_map;
}
};
template<typename Tp>
class uneq_allocator
: private uneq_allocator_base
{
public:
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef Tp* pointer;
typedef const Tp* const_pointer;
typedef Tp& reference;
typedef const Tp& const_reference;
typedef Tp value_type;
#if __cplusplus >= 201103L
typedef std::true_type propagate_on_container_swap;
#endif
template<typename Tp1>
struct rebind
{ typedef uneq_allocator<Tp1> other; };
uneq_allocator() _GLIBCXX_USE_NOEXCEPT
: personality(0) { }
uneq_allocator(int person) _GLIBCXX_USE_NOEXCEPT
: personality(person) { }
template<typename Tp1>
uneq_allocator(const uneq_allocator<Tp1>& b) _GLIBCXX_USE_NOEXCEPT
: personality(b.get_personality()) { }
~uneq_allocator() _GLIBCXX_USE_NOEXCEPT
{ }
int get_personality() const { return personality; }
pointer
address(reference x) const _GLIBCXX_NOEXCEPT
{ return std::__addressof(x); }
const_pointer
address(const_reference x) const _GLIBCXX_NOEXCEPT
{ return std::__addressof(x); }
pointer
allocate(size_type n, const void* = 0)
{
if (__builtin_expect(n > this->max_size(), false))
std::__throw_bad_alloc();
pointer p = static_cast<Tp*>(::operator new(n * sizeof(Tp)));
try
{
get_map().insert(map_type::value_type(reinterpret_cast<void*>(p),
personality));
}
catch(...)
{
::operator delete(p);
__throw_exception_again;
}
return p;
}
void
deallocate(pointer p, size_type)
{
bool test __attribute__((unused)) = true;
VERIFY( p );
map_type::iterator it = get_map().find(reinterpret_cast<void*>(p));
VERIFY( it != get_map().end() );
// Enforce requirements in Table 32 about deallocation vs
// allocator equality.
VERIFY( it->second == personality );
get_map().erase(it);
::operator delete(p);
}
size_type
max_size() const _GLIBCXX_USE_NOEXCEPT
testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. 2006-10-03 Benjamin Kosnik <bkoz@redhat.com> * testsuite/util/testsuite_allocator.h (allocation_tracker): To tracker_allocator_counter. (allocation_tracker::allocationTotal): To get_allocation_count. (allocation_tracker::deallocationTotal): To get_deallocation_count. (allocation_tracker::constructCount): To get_construct_count. (allocation_tracker::destructCount): To get_destruct_count. (allocation_tracker::resetCounts): To reset. (tracker_alloc): To tracker_allocator. * testsuite/util/performance/mem: Remove. * testsuite/util/performance/mem/mem_track_allocator_base.hpp: Remove. * testsuite/util/performance/mem/mem_track_allocator.hpp: Remove. * testsuite/27_io/basic_stringbuf/4.cc: Adjust for new names or includes. * testsuite/ext/hash_set/check_construct_destroy.cc: Same. * testsuite/ext/slist/check_construct_destroy.cc: Same. * testsuite/performance/ext/pb_ds/ hash_random_int_erase_mem_usage.cc: Same. * testsuite/performance/ext/pb_ds/multimap_text_insert_mem_usage.hpp * testsuite/performance/ext/pb_ds/ priority_queue_text_pop_mem_usage.cc: Same. * testsuite/23_containers/vector/capacity/2.cc: Same. * testsuite/23_containers/vector/cons/4.cc: Same. * testsuite/23_containers/vector/check_construct_destroy.cc: Same. * testsuite/23_containers/deque/cons/2.cc: Same. * testsuite/23_containers/deque/check_construct_destroy.cc: Same. * testsuite/23_containers/list/check_construct_destroy.cc: Same. * testsuite/23_containers/set/check_construct_destroy.cc: Same. * testsuite/util/testsuite_allocator.h * testsuite/util/performance/priority_queue/mem_usage/pop_test.hpp * testsuite/util/performance/assoc/mem_usage/multimap_insert_test.hpp * testsuite/util/performance/assoc/mem_usage/erase_test.hpp * testsuite/util/testsuite_allocator.cc: Same. From-SVN: r117408
2006-10-03 19:01:57 +02:00
{ return size_type(-1) / sizeof(Tp); }
#if __cplusplus >= 201103L
template<typename U, typename... Args>
throw_allocator.h (throw_allocator<>:: construct<>(pointer, _Args&&...)): Add. 2007-10-26 Paolo Carlini <pcarlini@suse.de> * include/ext/throw_allocator.h (throw_allocator<>:: construct<>(pointer, _Args&&...)): Add. * include/ext/pool_allocator.h (__pool_alloc<>:: construct<>(pointer, _Args&&...)): Likewise. (construct(pointer, const _Tp&)): Cast pointer to void*. * include/ext/bitmap_allocator.h (bitmap_allocator<>:: construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. * include/ext/new_allocator.h (new_allocator<>:: construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. * include/ext/malloc_allocator.h (malloc_allocator<>:: construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. * include/ext/array_allocator.h (array_allocator<>:: construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. * include/ext/mt_allocator.h (__mt_alloc<>:: construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. * testsuite/util/testsuite_allocator.h (tracker_allocator<>:: construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. (uneq_allocator<>::construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. * testsuite/ext/mt_allocator/variadic_construct.cc: New. * testsuite/ext/new_allocator/variadic_construct.cc: Likewise. * testsuite/ext/throw_allocator/variadic_construct.cc: Likewise. * testsuite/ext/malloc_allocator/variadic_construct.cc: Likewise. * testsuite/ext/pool_allocator/variadic_construct.cc: Likewise. * testsuite/ext/bitmap_allocator/variadic_construct.cc: Likewise. * testsuite/ext/array_allocator/variadic_construct.cc: Likewise. From-SVN: r129672
2007-10-27 02:41:21 +02:00
void
construct(U* p, Args&&... args)
{ ::new((void *)p) U(std::forward<Args>(args)...); }
throw_allocator.h (throw_allocator<>:: construct<>(pointer, _Args&&...)): Add. 2007-10-26 Paolo Carlini <pcarlini@suse.de> * include/ext/throw_allocator.h (throw_allocator<>:: construct<>(pointer, _Args&&...)): Add. * include/ext/pool_allocator.h (__pool_alloc<>:: construct<>(pointer, _Args&&...)): Likewise. (construct(pointer, const _Tp&)): Cast pointer to void*. * include/ext/bitmap_allocator.h (bitmap_allocator<>:: construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. * include/ext/new_allocator.h (new_allocator<>:: construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. * include/ext/malloc_allocator.h (malloc_allocator<>:: construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. * include/ext/array_allocator.h (array_allocator<>:: construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. * include/ext/mt_allocator.h (__mt_alloc<>:: construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. * testsuite/util/testsuite_allocator.h (tracker_allocator<>:: construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. (uneq_allocator<>::construct<>(pointer, _Args&&...)): Add. (construct(pointer, const _Tp&)): Cast pointer to void*. * testsuite/ext/mt_allocator/variadic_construct.cc: New. * testsuite/ext/new_allocator/variadic_construct.cc: Likewise. * testsuite/ext/throw_allocator/variadic_construct.cc: Likewise. * testsuite/ext/malloc_allocator/variadic_construct.cc: Likewise. * testsuite/ext/pool_allocator/variadic_construct.cc: Likewise. * testsuite/ext/bitmap_allocator/variadic_construct.cc: Likewise. * testsuite/ext/array_allocator/variadic_construct.cc: Likewise. From-SVN: r129672
2007-10-27 02:41:21 +02:00
template<typename U>
void
destroy(U* p) { p->~U(); }
// Not copy assignable...
uneq_allocator&
operator=(const uneq_allocator&) = delete;
#else
void
construct(pointer p, const Tp& val)
{ ::new((void *)p) Tp(val); }
void
destroy(pointer p) { p->~Tp(); }
private:
// Not assignable...
uneq_allocator&
operator=(const uneq_allocator&);
#endif
private:
// ... yet swappable!
friend inline void
swap(uneq_allocator& a, uneq_allocator& b)
{ std::swap(a.personality, b.personality); }
template<typename Tp1>
friend inline bool
operator==(const uneq_allocator& a, const uneq_allocator<Tp1>& b)
{ return a.personality == b.personality; }
template<typename Tp1>
friend inline bool
operator!=(const uneq_allocator& a, const uneq_allocator<Tp1>& b)
{ return !(a == b); }
int personality;
};
#if __cplusplus >= 201103L
// An uneq_allocator which can be used to test allocator propagation.
template<typename Tp, bool Propagate>
class propagating_allocator : public uneq_allocator<Tp>
{
typedef uneq_allocator<Tp> base_alloc;
base_alloc& base() { return *this; }
const base_alloc& base() const { return *this; }
void swap_base(base_alloc& b) { swap(b, this->base()); }
typedef std::integral_constant<bool, Propagate> trait_type;
public:
// default allocator_traits::rebind_alloc would select
// uneq_allocator::rebind so we must define rebind here
template<typename Up>
struct rebind { typedef propagating_allocator<Up, Propagate> other; };
propagating_allocator(int i) noexcept
: base_alloc(i)
{ }
template<typename Up>
propagating_allocator(const propagating_allocator<Up, Propagate>& a)
noexcept
: base_alloc(a)
{ }
propagating_allocator() noexcept = default;
propagating_allocator(const propagating_allocator&) noexcept = default;
propagating_allocator&
operator=(const propagating_allocator& a) noexcept
stl_map.h (map): Implement C++11 allocator-aware container requirements. * include/bits/stl_map.h (map): Implement C++11 allocator-aware container requirements. * include/bits/stl_multimap.h (multimap): Likewise. * include/bits/stl_multiset.h (multiset): Likewise. * include/bits/stl_set.h (set): Likewise. * include/bits/stl_tree.h (_Rb_tree_node): Use __aligned_buffer and add accessors for value. (_Rb_tree_iterator, _Rb_tree_const_iterator): Use _Rb_tree_node accessors. (_Rb_tree): Use allocator_traits and implement support for sets and maps the be allocator-aware. * include/bits/forward_list.h (_Fwd_list_base::_M_create_node): Do not zero-initialize storage buffer. * include/bits/hashtable_policy.h (_Hashtable_alloc::_M_allocate_node): Likewise. * include/bits/stl_vector.h (vector(vector&&, const allocator_type&)): Add conditional noexcept specification. * doc/xml/manual/status_cxx2011.xml: Update status of containers. * testsuite/util/testsuite_allocator.h: Re-indent. * testsuite/23_containers/forward_list/allocator/copy.cc: Test allocator-extended copy constructor. * testsuite/23_containers/unordered_map/allocator/copy.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/copy.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/copy.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/copy.cc: Likewise. * testsuite/23_containers/vector/allocator/copy.cc: Likewise. * testsuite/23_containers/forward_list/allocator/move.cc: New. * testsuite/23_containers/unordered_map/allocator/move.cc: New. * testsuite/23_containers/unordered_multimap/allocator/move.cc: New. * testsuite/23_containers/unordered_multiset/allocator/move.cc: New. * testsuite/23_containers/unordered_set/allocator/move.cc: New. * testsuite/23_containers/vector/allocator/move.cc: New. * testsuite/23_containers/map/allocator/copy.cc: New. * testsuite/23_containers/map/allocator/copy_assign.cc: New. * testsuite/23_containers/map/allocator/minimal.cc: New. * testsuite/23_containers/map/allocator/move.cc: New. * testsuite/23_containers/map/allocator/move_assign.cc: New. * testsuite/23_containers/map/allocator/noexcept.cc: New. * testsuite/23_containers/map/allocator/swap.cc: New. * testsuite/23_containers/multimap/allocator/copy.cc: New. * testsuite/23_containers/multimap/allocator/copy_assign.cc: New. * testsuite/23_containers/multimap/allocator/minimal.cc: New. * testsuite/23_containers/multimap/allocator/move.cc: New. * testsuite/23_containers/multimap/allocator/move_assign.cc: New. * testsuite/23_containers/multimap/allocator/noexcept.cc: New. * testsuite/23_containers/multimap/allocator/swap.cc: New. * testsuite/23_containers/multiset/allocator/copy.cc: New. * testsuite/23_containers/multiset/allocator/copy_assign.cc: New. * testsuite/23_containers/multiset/allocator/minimal.cc: New. * testsuite/23_containers/multiset/allocator/move.cc: New. * testsuite/23_containers/multiset/allocator/move_assign.cc: New. * testsuite/23_containers/multiset/allocator/noexcept.cc: New. * testsuite/23_containers/multiset/allocator/swap.cc: New. * testsuite/23_containers/set/allocator/copy.cc: New. * testsuite/23_containers/set/allocator/copy_assign.cc: New. * testsuite/23_containers/set/allocator/minimal.cc: New. * testsuite/23_containers/set/allocator/move.cc: New. * testsuite/23_containers/set/allocator/move_assign.cc: New. * testsuite/23_containers/set/allocator/noexcept.cc: New. * testsuite/23_containers/set/allocator/swap.cc: New. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Adjust dg-error line number. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. From-SVN: r204848
2013-11-15 16:34:14 +01:00
{
static_assert(Propagate, "assigning propagating_allocator<T, true>");
propagating_allocator(a).swap_base(*this);
return *this;
}
template<bool P2>
propagating_allocator&
operator=(const propagating_allocator<Tp, P2>& a) noexcept
{
static_assert(P2, "assigning propagating_allocator<T, true>");
propagating_allocator(a).swap_base(*this);
return *this;
}
// postcondition: a.get_personality() == 0
propagating_allocator(propagating_allocator&& a) noexcept
: base_alloc()
{ swap_base(a); }
// postcondition: a.get_personality() == 0
propagating_allocator&
operator=(propagating_allocator&& a) noexcept
{
propagating_allocator(std::move(a)).swap_base(*this);
return *this;
}
typedef trait_type propagate_on_container_copy_assignment;
typedef trait_type propagate_on_container_move_assignment;
typedef trait_type propagate_on_container_swap;
propagating_allocator select_on_container_copy_construction() const
{ return Propagate ? *this : propagating_allocator(); }
};
// Class template supporting the minimal interface that satisfies the
// Allocator requirements, from example in [allocator.requirements]
template <class Tp>
struct SimpleAllocator
{
typedef Tp value_type;
SimpleAllocator() { }
template <class T>
SimpleAllocator(const SimpleAllocator<T>& other) { }
Tp *allocate(std::size_t n)
{ return std::allocator<Tp>().allocate(n); }
void deallocate(Tp *p, std::size_t n)
{ std::allocator<Tp>().deallocate(p, n); }
};
template <class T, class U>
bool operator==(const SimpleAllocator<T>&, const SimpleAllocator<U>&)
{ return true; }
template <class T, class U>
bool operator!=(const SimpleAllocator<T>&, const SimpleAllocator<U>&)
{ return false; }
#endif
re PR libstdc++/50118 (node-based containers cannot use allocators with explicit constructor template) 2011-08-29 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/50118 * include/bits/stl_list.h (_List_base<>:: _List_base(const allocator_type&)): Remove. (_List_base<>::_List_base(const _Node_alloc_type&)): Add. (list<>:list(const allocator_type&), list(size_type, const value_type&, const allocator_type&), list(initializer_list<, const allocator_type&), list(_InputIterator, _InputIterator, const allocator_type&), insert(iterator, size_type, const value_type&), insert(iterator, _InputIterator, _InputIterator)): Adjust. * include/bits/stl_tree.h (_Rb_tree<>::_Rb_tree(const _Compare&, const allocator_type&)): Fix. * include/bits/stl_map.h (map<>::map(const _Compare&, const allocator_type&), map(initializer_list<>, const _Compare&, const allocator_type&), map(_InputIterator, _InputIterator, const _Compare&, const allocator_type&), get_allocator): Adjust. * include/bits/stl_set.h (set<>::set(const _Compare&, const allocator_type&), set(initializer_list<>, const _Compare&, const allocator_type&), set(_InputIterator, _InputIterator, const _Compare&, const allocator_type&), get_allocator): Likewise. * include/bits/stl_multimap.h (multimap<>::multimap(const _Compare&, const allocator_type&), multimap(initializer_list<>, const _Compare&, const allocator_type&), multimap(_InputIterator, _InputIterator, const _Compare&, const allocator_type&), get_allocator): Likewise. * include/bits/stl_multiset.h (multiset<>::multiset(const _Compare&, const allocator_type&), multiset(initializer_list<>, const _Compare&, const allocator_type&), multiset(_InputIterator, _InputIterator, const _Compare&, const allocator_type&), get_allocator): Likewise. * include/bits/forward_list.h (_Fwd_list_base<>:: _Fwd_list_base(const _Alloc&), _Fwd_list_base(const _Fwd_list_base&, const _Alloc&), _Fwd_list_base(_Fwd_list_base&&, const _Alloc&)): Remove. (_Fwd_list_base<>::_Fwd_list_base(const _Node_alloc_type&), _Fwd_list_base(const _Fwd_list_base&, const _Node_alloc_type&), _Fwd_list_base(_Fwd_list_base&&, const _Node_alloc_type&)): Add. (forward_list<>::forward_list(const _Alloc&), forward_list(const forward_list&, const _Alloc&), forward_list(forward_list&&, const _Alloc&), forward_list(size_type, const _Tp&, const _Alloc&), forward_list(_InputIterator, _InputIterator, const _Alloc&), forward_list(std::initializer_list<>, const _Alloc&), get_allocator): Adjust. * include/bits/forward_list.tcc * testsuite/util/testsuite_allocator.h (ExplicitConsAlloc): Add. * testsuite/23_containers/unordered_map/requirements/ explicit_instantiation/5.cc: New. * testsuite/23_containers/multimap/requirements/ explicit_instantiation/5.cc: Likewise. * testsuite/23_containers/multimap/requirements/ explicit_instantiation/5_c++0x.cc: Likewise. * testsuite/23_containers/set/requirements/explicit_instantiation/ 5.cc: Likewise. * testsuite/23_containers/set/requirements/explicit_instantiation/ 5_c++0x.cc: Likewise. * testsuite/23_containers/unordered_multimap/requirements/ explicit_instantiation/5.cc: Likewise. * testsuite/23_containers/forward_list/requirements/ explicit_instantiation/5.cc: Likewise. * testsuite/23_containers/unordered_set/requirements/ explicit_instantiation/5.cc: Likewise. testsuite/23_containers/multiset/requirements/explicit_instantiation/ 5.cc: Likewise. * testsuite/23_containers/multiset/requirements/ explicit_instantiation/5_c++0x.cc: Likewise. * testsuite/23_containers/list/requirements/explicit_instantiation/ 5_c++0x.cc: Likewise. * testsuite/23_containers/list/requirements/explicit_instantiation/ 5.cc: Likewise. * testsuite/23_containers/unordered_multiset/requirements/ explicit_instantiation/5.cc: Likewise. * testsuite/23_containers/map/requirements/explicit_instantiation/ 5.cc: Likewise. * testsuite/23_containers/map/requirements/explicit_instantiation/ 5_c++0x.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Adjust dg-error line number. * 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/23_containers/list/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Likewise. From-SVN: r178230
2011-08-29 15:40:33 +02:00
template<typename Tp>
struct ExplicitConsAlloc : std::allocator<Tp>
{
ExplicitConsAlloc() { }
template<typename Up>
explicit
ExplicitConsAlloc(const ExplicitConsAlloc<Up>&) { }
template<typename Up>
struct rebind
{ typedef ExplicitConsAlloc<Up> other; };
};
#if __cplusplus >= 201103L
template<typename Tp>
class CustomPointerAlloc : public std::allocator<Tp>
{
template<typename Up, typename Sp = __gnu_cxx::_Std_pointer_impl<Up>>
using Ptr = __gnu_cxx::_Pointer_adapter<Sp>;
public:
CustomPointerAlloc() = default;
template<typename Up>
CustomPointerAlloc(const CustomPointerAlloc<Up>&) { }
template<typename Up>
struct rebind
{ typedef CustomPointerAlloc<Up> other; };
typedef Ptr<Tp> pointer;
typedef Ptr<const Tp> const_pointer;
typedef Ptr<void> void_pointer;
typedef Ptr<const void> const_void_pointer;
pointer allocate(std::size_t n, pointer = {})
{ return pointer(std::allocator<Tp>::allocate(n)); }
void deallocate(pointer p, std::size_t n)
{ std::allocator<Tp>::deallocate(std::addressof(*p), n); }
};
#endif
} // namespace __gnu_test
#endif // _GLIBCXX_TESTSUITE_ALLOCATOR_H