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
This commit is contained in:
parent
717a7d5d00
commit
1b90e7a391
7 changed files with 97 additions and 39 deletions
|
@ -1,3 +1,16 @@
|
|||
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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue