This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
testsuite allocator patch
- From: François Dumont <frs dot dumont at gmail dot com>
- To: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Thu, 01 Sep 2011 22:20:35 +0200
- Subject: testsuite allocator patch
Hi
A small patch for a small issue detected while playing with
tracker_allocator. I considered that allocation count should represent
the number of allocated bytes and not the number of requested bytes.
2011-09-01 François Dumont <frs.dumont@gmail.com>
* testsuite/util/testsuite_allocator.h
(tracker_allocator_counter::allocate): Update
allocation count only if allocation succeeded.
Tested under linux x86_64.
François
Index: testsuite/util/testsuite_allocator.h
===================================================================
--- testsuite/util/testsuite_allocator.h (revision 178124)
+++ testsuite/util/testsuite_allocator.h (working copy)
@@ -41,8 +41,9 @@
static void*
allocate(size_type blocksize)
{
+ void* p = ::operator new(blocksize);
allocationCount_ += blocksize;
- return ::operator new(blocksize);
+ return p;
}
static void