aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-4.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-4.cc')
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-4.cc25
1 files changed, 9 insertions, 16 deletions
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-4.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-4.cc
index da2c1e96360..ef124bf687f 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-4.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-4.cc
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -14,7 +14,7 @@
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 20.4.1.1 allocator members
@@ -22,19 +22,20 @@
#include <string>
#include <stdexcept>
#include <ext/mt_allocator.h>
-#include <testsuite_hooks.h>
static size_t count;
struct count_check
{
- count_check() {}
+ count_check() { }
~count_check()
{
+ // NB: __mt_allocator doesn't clean itself up. Thus, this will not
+ // be zero.
if (count != 0)
{
- // NB: __mt_allocator doesn't clean itself up. Thus, this will
- // not be zero.
+ printf("allocation/deallocation count is %zu \n", count);
+ //throw std::runtime_error("allocation/deallocation count isn't zero");
}
}
};
@@ -57,11 +58,6 @@ void operator delete(void* p) throw()
if (p == NULL)
return;
count--;
- if (count == 0)
- printf("All memory released \n");
- else
- printf("%u allocations to be released \n", count);
- free(p);
}
typedef char value_type;
@@ -74,10 +70,7 @@ typedef std::basic_string<value_type, traits_type, allocator_type> string_type;
int main()
{
- bool test __attribute__((unused)) = true;
- {
- string_type s;
- s += "bayou bend";
- }
+ string_type s;
+ s += "bayou bend";
return 0;
}