diff options
author | Felix Yen <fwy@alumni.brown.edu> | 2004-01-30 18:14:42 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2004-01-30 18:14:42 +0000 |
commit | 7b1d1edf9946d53d17fbd1e7a67c2422156c4c1e (patch) | |
tree | f63c283bb715f55f67f5a2d19ada499287ba6c08 /libstdc++-v3 | |
parent | c9732ce7d527ee3d3adcabe524242221096eedd3 (diff) | |
download | gcc-7b1d1edf9946d53d17fbd1e7a67c2422156c4c1e.zip gcc-7b1d1edf9946d53d17fbd1e7a67c2422156c4c1e.tar.gz gcc-7b1d1edf9946d53d17fbd1e7a67c2422156c4c1e.tar.bz2 |
allocator_thread.cc (do_loop): Don't use clear, but instead assign.
2004-01-30 Felix Yen <fwy@alumni.brown.edu>
* testsuite/performance/20_util/allocator_thread.cc (do_loop):
Don't use clear, but instead assign. Use insert.
From-SVN: r76979
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 5 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/performance/20_util/allocator_thread.cc | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index a83d268..10068e9 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2004-01-30 Felix Yen <fwy@alumni.brown.edu> + + * testsuite/performance/20_util/allocator_thread.cc (do_loop): + Don't use clear, but instead assign. Use insert. + 2004-01-30 Benjamin Kosnik <bkoz@redhat.com> * src/demangle.cc: Add instantiations. diff --git a/libstdc++-v3/testsuite/performance/20_util/allocator_thread.cc b/libstdc++-v3/testsuite/performance/20_util/allocator_thread.cc index b313a1f..e9e8428 100644 --- a/libstdc++-v3/testsuite/performance/20_util/allocator_thread.cc +++ b/libstdc++-v3/testsuite/performance/20_util/allocator_thread.cc @@ -73,15 +73,16 @@ template<typename Container> while (test_iterations < iterations) { for (int j = 0; j < insert_values; ++j) - obj.push_back(test_iterations); + obj.insert(obj.begin(), test_iterations); ++test_iterations; } - obj.clear(); + // NB: Don't use clear() here, instead force deallocation. + obj = Container(); test_iterations = 0; while (test_iterations < iterations) { for (int j = 0; j < insert_values; ++j) - obj.push_back(test_iterations); + obj.insert(obj.begin(), test_iterations); ++test_iterations; } } |