diff options
author | Paolo Carlini <pcarlini@suse.de> | 2004-08-19 20:22:45 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2004-08-19 20:22:45 +0000 |
commit | 1b90e7a391c8c8d93e3d075dfbc6b9ab37fa6e39 (patch) | |
tree | 26e4f819731eb567a1f1c8eab30e38d11f5e970f | |
parent | 717a7d5d006f2e88ba48e7d2984a70f7a9731412 (diff) | |
download | gcc-1b90e7a391c8c8d93e3d075dfbc6b9ab37fa6e39.zip gcc-1b90e7a391c8c8d93e3d075dfbc6b9ab37fa6e39.tar.gz gcc-1b90e7a391c8c8d93e3d075dfbc6b9ab37fa6e39.tar.bz2 |
insert.cc: For std::map instantiate the allocator for a correct pair type.
2004-08-19 Paolo Carlini <pcarlini@suse.de>
* testsuite/performance/20_util/allocator/insert.cc: For std::map
instantiate the allocator for a correct pair type.
* testsuite/performance/20_util/allocator/insert_insert.cc: Likewise.
* testsuite/performance/20_util/allocator/map_thread.cc: Likewise.
* testsuite/performance/20_util/allocator/producer_consumer.cc:
Likewise.
* testsuite/performance/20_util/allocator/list_sort_search.cc: Very
minor formatting fixes.
* testsuite/performance/20_util/allocator/map_mt_find.cc: Likewise.
From-SVN: r86269
7 files changed, 97 insertions, 39 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index e934d3b..f849f16 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,18 @@ 2004-08-19 Paolo Carlini <pcarlini@suse.de> + * testsuite/performance/20_util/allocator/insert.cc: For std::map + instantiate the allocator for a correct pair type. + * testsuite/performance/20_util/allocator/insert_insert.cc: Likewise. + * testsuite/performance/20_util/allocator/map_thread.cc: Likewise. + * testsuite/performance/20_util/allocator/producer_consumer.cc: + Likewise. + + * testsuite/performance/20_util/allocator/list_sort_search.cc: Very + minor formatting fixes. + * testsuite/performance/20_util/allocator/map_mt_find.cc: Likewise. + +2004-08-19 Paolo Carlini <pcarlini@suse.de> + * testsuite/22_locale/time_put/put/char/1.cc: Add VERIFY on the results. * testsuite/22_locale/time_put/put/char/2.cc: Likewise. diff --git a/libstdc++-v3/testsuite/performance/20_util/allocator/insert.cc b/libstdc++-v3/testsuite/performance/20_util/allocator/insert.cc index d9c8ced..372b7e0 100644 --- a/libstdc++-v3/testsuite/performance/20_util/allocator/insert.cc +++ b/libstdc++-v3/testsuite/performance/20_util/allocator/insert.cc @@ -200,20 +200,32 @@ int main(void) #endif typedef less<test_type> compare_type; + typedef pair<const test_type, test_type> pair_type; + typedef __gnu_cxx::malloc_allocator<pair_type> m_pair_alloc_type; + typedef __gnu_cxx::new_allocator<pair_type> n_pair_alloc_type; + typedef __gnu_cxx::__mt_alloc<pair_type> so_pair_alloc_type; + typedef __gnu_cxx::bitmap_allocator<pair_type> bit_pair_alloc_type; + typedef __gnu_cxx::__pool_alloc<pair_type> po_pair_alloc_type; + #ifdef TEST_B15 - test_container(map<test_type, test_type, compare_type, m_alloc_type>()); + test_container(map<test_type, test_type, compare_type, + m_pair_alloc_type>()); #endif #ifdef TEST_B16 - test_container(map<test_type, test_type, compare_type, n_alloc_type>()); + test_container(map<test_type, test_type, compare_type, + n_pair_alloc_type>()); #endif #ifdef TEST_B17 - test_container(map<test_type, test_type, compare_type, so_alloc_type>()); + test_container(map<test_type, test_type, compare_type, + so_pair_alloc_type>()); #endif #ifdef TEST_B18 - test_container(map<test_type, test_type, compare_type, bit_alloc_type>()); + test_container(map<test_type, test_type, compare_type, + bit_pair_alloc_type>()); #endif #ifdef TEST_B19 - test_container(map<test_type, test_type, compare_type, po_alloc_type>()); + test_container(map<test_type, test_type, compare_type, + po_pair_alloc_type>()); #endif #ifdef TEST_B20 @@ -280,21 +292,25 @@ int main(void) test_container(deque<test_type, po_alloc_type>(), true); #endif - typedef less<test_type> compare_type; #ifdef TEST_T15 - test_container(map<test_type, test_type, compare_type, m_alloc_type>(), true); + test_container(map<test_type, test_type, compare_type, + m_pair_alloc_type>(), true); #endif #ifdef TEST_T16 - test_container(map<test_type, test_type, compare_type, n_alloc_type>(), true); + test_container(map<test_type, test_type, compare_type, + n_pair_alloc_type>(), true); #endif #ifdef TEST_T17 - test_container(map<test_type, test_type, compare_type, so_alloc_type>(), true); + test_container(map<test_type, test_type, compare_type, + so_pair_alloc_type>(), true); #endif #ifdef TEST_T18 - test_container(map<test_type, test_type, compare_type, bit_alloc_type>(), true); + test_container(map<test_type, test_type, compare_type, + bit_pair_alloc_type>(), true); #endif #ifdef TEST_T19 - test_container(map<test_type, test_type, compare_type, po_alloc_type>(), true); + test_container(map<test_type, test_type, compare_type, + po_pair_alloc_type>(), true); #endif #ifdef TEST_T20 diff --git a/libstdc++-v3/testsuite/performance/20_util/allocator/insert_insert.cc b/libstdc++-v3/testsuite/performance/20_util/allocator/insert_insert.cc index ef1ff52..455c9a4 100644 --- a/libstdc++-v3/testsuite/performance/20_util/allocator/insert_insert.cc +++ b/libstdc++-v3/testsuite/performance/20_util/allocator/insert_insert.cc @@ -171,20 +171,32 @@ int main(void) #endif typedef less<test_type> compare_type; + typedef pair<const test_type, test_type> pair_type; + typedef __gnu_cxx::malloc_allocator<pair_type> m_pair_alloc_type; + typedef __gnu_cxx::new_allocator<pair_type> n_pair_alloc_type; + typedef __gnu_cxx::__mt_alloc<pair_type> so_pair_alloc_type; + typedef __gnu_cxx::bitmap_allocator<pair_type> bit_pair_alloc_type; + typedef __gnu_cxx::__pool_alloc<pair_type> po_pair_alloc_type; + #ifdef TEST_S15 - test_container(map<test_type, test_type, compare_type, m_alloc_type>()); + test_container(map<test_type, test_type, compare_type, + m_pair_alloc_type>()); #endif #ifdef TEST_S16 - test_container(map<test_type, test_type, compare_type, n_alloc_type>()); + test_container(map<test_type, test_type, compare_type, + n_pair_alloc_type>()); #endif #ifdef TEST_S17 - test_container(map<test_type, test_type, compare_type, so_alloc_type>()); + test_container(map<test_type, test_type, compare_type, + so_pair_alloc_type>()); #endif #ifdef TEST_S18 - test_container(map<test_type, test_type, compare_type, bit_alloc_type>()); + test_container(map<test_type, test_type, compare_type, + bit_pair_alloc_type>()); #endif #ifdef TEST_S19 - test_container(map<test_type, test_type, compare_type, po_alloc_type>()); + test_container(map<test_type, test_type, compare_type, + po_pair_alloc_type>()); #endif #ifdef TEST_S20 diff --git a/libstdc++-v3/testsuite/performance/20_util/allocator/list_sort_search.cc b/libstdc++-v3/testsuite/performance/20_util/allocator/list_sort_search.cc index 09d1821..cce55cc 100644 --- a/libstdc++-v3/testsuite/performance/20_util/allocator/list_sort_search.cc +++ b/libstdc++-v3/testsuite/performance/20_util/allocator/list_sort_search.cc @@ -28,17 +28,16 @@ // 2004-03-11 Dhruv Matani <dhruvbird@HotPOP.com> #include <list> -#include <map> #include <algorithm> #include <cstdlib> #include <typeinfo> #include <sstream> #include <ext/mt_allocator.h> #include <ext/malloc_allocator.h> -#include <cxxabi.h> -#include <testsuite_performance.h> #include <ext/bitmap_allocator.h> #include <ext/pool_allocator.h> +#include <cxxabi.h> +#include <testsuite_performance.h> using namespace std; using __gnu_cxx::malloc_allocator; diff --git a/libstdc++-v3/testsuite/performance/20_util/allocator/map_mt_find.cc b/libstdc++-v3/testsuite/performance/20_util/allocator/map_mt_find.cc index 415f322..a3ab267 100644 --- a/libstdc++-v3/testsuite/performance/20_util/allocator/map_mt_find.cc +++ b/libstdc++-v3/testsuite/performance/20_util/allocator/map_mt_find.cc @@ -36,10 +36,10 @@ #include <sstream> #include <ext/mt_allocator.h> #include <ext/malloc_allocator.h> -#include <cxxabi.h> -#include <testsuite_performance.h> #include <ext/bitmap_allocator.h> #include <ext/pool_allocator.h> +#include <cxxabi.h> +#include <testsuite_performance.h> using namespace std; using __gnu_cxx::malloc_allocator; @@ -48,9 +48,7 @@ using __gnu_cxx::__mt_alloc; using __gnu_cxx::bitmap_allocator; using __gnu_cxx::__pool_alloc; -typedef int test_type; - -bool less_int(int x1, int x2) { return x1<x2; } +bool less_int(int x1, int x2) { return x1 < x2; } #if defined USE_FUNCTION_COMPARE #define COMPARE_T typeof(&less_int) @@ -133,19 +131,21 @@ template <typename Alloc> int main() { + typedef pair<const int, string> pair_type; + #ifdef TEST_T0 - exec_tests<new_allocator<int> >(); + exec_tests<new_allocator<pair_type> >(); #endif #ifdef TEST_T1 - exec_tests<malloc_allocator<int> >(); + exec_tests<malloc_allocator<pair_type> >(); #endif #ifdef TEST_T2 - exec_tests<__mt_alloc<int> >(); + exec_tests<__mt_alloc<pair_type> >(); #endif #ifdef TEST_T3 - exec_tests<bitmap_allocator<int> >(); + exec_tests<bitmap_allocator<pair_type> >(); #endif #ifdef TEST_T4 - exec_tests<__pool_alloc<int> >(); + exec_tests<__pool_alloc<pair_type> >(); #endif } diff --git a/libstdc++-v3/testsuite/performance/20_util/allocator/map_thread.cc b/libstdc++-v3/testsuite/performance/20_util/allocator/map_thread.cc index c9cf34c..487a8aa 100644 --- a/libstdc++-v3/testsuite/performance/20_util/allocator/map_thread.cc +++ b/libstdc++-v3/testsuite/performance/20_util/allocator/map_thread.cc @@ -111,24 +111,30 @@ template<typename Container> int main(void) { + typedef pair<const int, int> pair_type; + #ifdef TEST_T0 test_container(map<int, int>()); #endif #ifdef TEST_T1 - test_container(map<int, int, less<const int>, new_allocator<int> >()); + test_container(map<int, int, less<const int>, + new_allocator<pair_type> >()); #endif #ifdef TEST_T2 - test_container(map<int, int, less<const int>, malloc_allocator<int> >()); + test_container(map<int, int, less<const int>, + malloc_allocator<pair_type> >()); #endif #ifdef TEST_T3 test_container(map<int, int, less<const int>, - __mt_alloc< pair<const int, int> > >()); + __mt_alloc<pair_type> >()); #endif #ifdef TEST_T4 - test_container(map<int, int, less<const int>, bitmap_allocator<int> >()); + test_container(map<int, int, less<const int>, + bitmap_allocator<pair_type> >()); #endif #ifdef TEST_T5 - test_container(map<int, int, less<const int>, __pool_alloc<int> >()); + test_container(map<int, int, less<const int>, + __pool_alloc<pair_type> >()); #endif return 0; } diff --git a/libstdc++-v3/testsuite/performance/20_util/allocator/producer_consumer.cc b/libstdc++-v3/testsuite/performance/20_util/allocator/producer_consumer.cc index 98f39c19..dd277a9 100644 --- a/libstdc++-v3/testsuite/performance/20_util/allocator/producer_consumer.cc +++ b/libstdc++-v3/testsuite/performance/20_util/allocator/producer_consumer.cc @@ -63,6 +63,13 @@ typedef __mt_alloc<test_type> so_alloc_type; typedef bitmap_allocator<test_type> bit_alloc_type; typedef __pool_alloc<test_type> po_alloc_type; +typedef pair<const test_type, test_type> pair_type; +typedef malloc_allocator<pair_type> malloc_pair_alloc_type; +typedef new_allocator<pair_type> new_pair_alloc_type; +typedef __mt_alloc<pair_type> so_pair_alloc_type; +typedef bitmap_allocator<pair_type> bit_pair_alloc_type; +typedef __pool_alloc<pair_type> po_pair_alloc_type; + // The number of iterations to be performed. int iterations = 10000; @@ -323,19 +330,24 @@ int main(void) #endif #ifdef TEST_T10 - test_container(map<test_type, test_type, compare_type, malloc_alloc_type>()); + test_container(map<test_type, test_type, compare_type, + malloc_pair_alloc_type>()); #endif #ifdef TEST_T11 - test_container(map<test_type, test_type, compare_type, new_alloc_type>()); + test_container(map<test_type, test_type, compare_type, + new_pair_alloc_type>()); #endif #ifdef TEST_T12 - test_container(map<test_type, test_type, compare_type, so_alloc_type>()); + test_container(map<test_type, test_type, compare_type, + so_pair_alloc_type>()); #endif #ifdef TEST_T13 - test_container(map<test_type, test_type, compare_type, bit_alloc_type>()); + test_container(map<test_type, test_type, compare_type, + bit_pair_alloc_type>()); #endif #ifdef TEST_T14 - test_container(map<test_type, test_type, compare_type, po_alloc_type>()); + test_container(map<test_type, test_type, compare_type, + po_pair_alloc_type>()); #endif return 0; |