testsuite_allocator.h (tracker_allocator_counter:: allocate): Update allocation count only if allocation succeeded.
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
This commit is contained in:
parent
d7da5cc85c
commit
e1f3ce0db1
|
@ -1,3 +1,8 @@
|
||||||
|
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>
|
2011-09-02 Paolo Carlini <paolo.carlini@oracle.com>
|
||||||
|
|
||||||
* include/std/bitset: Trivial formatting fixes.
|
* include/std/bitset: Trivial formatting fixes.
|
||||||
|
|
|
@ -37,14 +37,15 @@ namespace __gnu_test
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef std::size_t size_type;
|
typedef std::size_t size_type;
|
||||||
|
|
||||||
static void*
|
static void*
|
||||||
allocate(size_type blocksize)
|
allocate(size_type blocksize)
|
||||||
{
|
{
|
||||||
|
void* p = ::operator new(blocksize);
|
||||||
allocationCount_ += blocksize;
|
allocationCount_ += blocksize;
|
||||||
return ::operator new(blocksize);
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
construct() { constructCount_++; }
|
construct() { constructCount_++; }
|
||||||
|
|
||||||
|
@ -57,19 +58,19 @@ namespace __gnu_test
|
||||||
::operator delete(p);
|
::operator delete(p);
|
||||||
deallocationCount_ += blocksize;
|
deallocationCount_ += blocksize;
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_type
|
static size_type
|
||||||
get_allocation_count() { return allocationCount_; }
|
get_allocation_count() { return allocationCount_; }
|
||||||
|
|
||||||
static size_type
|
static size_type
|
||||||
get_deallocation_count() { return deallocationCount_; }
|
get_deallocation_count() { return deallocationCount_; }
|
||||||
|
|
||||||
static int
|
static int
|
||||||
get_construct_count() { return constructCount_; }
|
get_construct_count() { return constructCount_; }
|
||||||
|
|
||||||
static int
|
static int
|
||||||
get_destruct_count() { return destructCount_; }
|
get_destruct_count() { return destructCount_; }
|
||||||
|
|
||||||
static void
|
static void
|
||||||
reset()
|
reset()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue