2004-01-30 Felix Yen <fwy@alumni.brown.edu>
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 30 Jan 2004 18:14:42 +0000 (18:14 +0000)
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 30 Jan 2004 18:14:42 +0000 (18:14 +0000)
* testsuite/performance/20_util/allocator_thread.cc (do_loop):
Don't use clear, but instead assign. Use insert.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76979 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/performance/20_util/allocator_thread.cc

index a83d268..10068e9 100644 (file)
@@ -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.
index b313a1f..e9e8428 100644 (file)
@@ -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;
          }
       }