2011-09-02 François Dumont <fdumont@gcc.gnu.org>
* testsuite/util/testsuite_allocator.h (tracker_allocator_counter::
allocate): Update allocation count only if allocation succeeded.
From-SVN: r178486
+2011-09-02 François Dumont <fdumont@gcc.gnu.org>
+
+ * testsuite/util/testsuite_allocator.h (tracker_allocator_counter::
+ allocate): Update allocation count only if allocation succeeded.
+
2011-09-02 Paolo Carlini <paolo.carlini@oracle.com>
* include/std/bitset: Trivial formatting fixes.
{
public:
typedef std::size_t size_type;
-
+
static void*
allocate(size_type blocksize)
{
+ void* p = ::operator new(blocksize);
allocationCount_ += blocksize;
- return ::operator new(blocksize);
+ return p;
}
-
+
static void
construct() { constructCount_++; }
::operator delete(p);
deallocationCount_ += blocksize;
}
-
+
static size_type
get_allocation_count() { return allocationCount_; }
-
+
static size_type
get_deallocation_count() { return deallocationCount_; }
-
+
static int
get_construct_count() { return constructCount_; }
static int
get_destruct_count() { return destructCount_; }
-
+
static void
reset()
{