diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-23 23:53:07 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-23 23:53:07 +0000 |
commit | 375daafd336e7d30887c28b5d0868d9067ebb3a3 (patch) | |
tree | ba54e6540172390f66813164e039aaafc3e2a9f3 /libstdc++-v3/testsuite/ext/mt_allocator/tune-4.cc | |
parent | 732fe7c028cee8644a803e35fd52b9ee58e51b9e (diff) | |
download | gcc-375daafd336e7d30887c28b5d0868d9067ebb3a3.tar.gz |
2005-09-23 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/ext/mt_allocator/tune-1.cc: Clarify for single-thread.
* testsuite/ext/mt_allocator/tune-2.cc: Same.
* testsuite/ext/mt_allocator/tune-3.cc: Same.
* testsuite/ext/mt_allocator/tune-4.cc: Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104591 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/ext/mt_allocator/tune-4.cc')
-rw-r--r-- | libstdc++-v3/testsuite/ext/mt_allocator/tune-4.cc | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/tune-4.cc b/libstdc++-v3/testsuite/ext/mt_allocator/tune-4.cc index 744429d867a..cbde1992290 100644 --- a/libstdc++-v3/testsuite/ext/mt_allocator/tune-4.cc +++ b/libstdc++-v3/testsuite/ext/mt_allocator/tune-4.cc @@ -1,6 +1,6 @@ // 2004-08-25 Benjamin Kosnik <bkoz@redhat.com> // -// Copyright (C) 2004 Free Software Foundation, Inc. +// Copyright (C) 2004, 2005 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 @@ -54,52 +54,46 @@ void test04() typedef __gnu_cxx::__pool_base::_Tune tune_type; typedef _Tp value_type; typedef _Cp policy_type; - typedef __gnu_cxx::__mt_alloc<value_type, policy_type> allocator_type; - tune_type t_opt(16, 5120, 32, 5120, 20, 10, false); - tune_type t_single(16, 5120, 32, 5120, 1, 10, false); allocator_type a; tune_type t_default = a._M_get_options(); + tune_type t_opt(32, 5120, 32, 5120, 20, 10, false); + tune_type t_small(16, 1024, 32, 2048, 1, 10, false); + + // First instance of local type assured. tune_type t1 = t_default; - tune_type t2; if (test_policy<policy_type>::per_type()) { a._M_set_options(t_opt); - t2 = a._M_get_options(); - VERIFY( t1._M_align != t2._M_align ); + t1 = a._M_get_options(); + VERIFY( t1._M_align != t_default._M_align ); } - else - t2 = t1; // Lock tune settings. typename allocator_type::pointer p1 = a.allocate(128); - // First instance of local type assured. typedef pod2 value2_type; typedef typename allocator_type::template rebind<value2_type>::other rebind_type; rebind_type a2; - tune_type t3 = a2._M_get_options(); - tune_type t4; + tune_type t2 = a2._M_get_options(); // Both policy_type and rebind_type::policy_type have same characteristics. if (test_policy<policy_type>::per_type()) { a2._M_set_options(t_opt); - t4 = a2._M_get_options(); - VERIFY( t3._M_align != t4._M_align ); - t3 = t4; + tune_type t = a2._M_get_options(); + VERIFY( t2._M_align != t._M_align ); + t2 = t; } - else - VERIFY( t3._M_max_threads == t2._M_max_threads ); typename rebind_type::pointer p2 = a2.allocate(5128); - a2._M_set_options(t_single); - t4 = a2._M_get_options(); - VERIFY( t4._M_max_threads != t_single._M_max_threads ); - VERIFY( t4._M_max_threads == t3._M_max_threads ); + a2._M_set_options(t_small); + tune_type t4 = a2._M_get_options(); + VERIFY( t4._M_chunk_size != t_small._M_chunk_size ); + VERIFY( t4._M_chunk_size == t2._M_chunk_size ); a.deallocate(p1, 128); a2.deallocate(p2, 5128); |