From 7b0420368989001a7146b899a51e88bf8ae7a1cb Mon Sep 17 00:00:00 2001 From: bkoz Date: Tue, 12 Oct 2004 01:10:39 +0000 Subject: 2004-10-11 Benjamin Kosnik * include/bits/stl_deque.h: Correct for over-long lines. 2004-10-11 Benjamin Kosnik PR libstdc++/17937 * include/ext/mt_allocator.h (__pool::_M_destroy): New. * src/mt_allocator.cc (__pool::~__pool): Change definitions to _M_destroy. * acconfig.h: Remove _GLIBCXX_USE___CXA_ATEXIT. * acinclude.m4 (GLIBCXX_ENABLE_CXA_ATEXIT): Remove. * configure.ac: Remove call to GLIBCXX_ENABLE_CXA_EXIT. * configure: Regenerate. * config/linker-map.gnu: Tweak exports. * docs/html/ext/mt_allocator.html: Update docs. * testsuite/ext/mt_allocator/deallocate_global-2.cc: Fix. * testsuite/ext/mt_allocator/deallocate_global-4.cc: Fix. * testsuite/ext/mt_allocator/deallocate_global_thread-1.cc: Fix. * testsuite/ext/mt_allocator/deallocate_global_thread-3.cc: Fix. * testsuite/ext/mt_allocator/deallocate_local-2.cc: Fix. * testsuite/ext/mt_allocator/deallocate_local-4.cc: Fix. * testsuite/ext/mt_allocator/deallocate_local_thread-3.cc: Fix. * testsuite/ext/mt_allocator/deallocate_local_thread-1.cc: Fix. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88913 138bc75d-0d04-0410-961f-82ee72b054a4 --- .../ext/mt_allocator/deallocate_global-2.cc | 23 +++++++++++++--------- .../ext/mt_allocator/deallocate_global-4.cc | 23 +++++++++++++--------- .../ext/mt_allocator/deallocate_global_thread-1.cc | 23 +++++++++++++--------- .../ext/mt_allocator/deallocate_global_thread-3.cc | 23 +++++++++++++--------- .../ext/mt_allocator/deallocate_local-2.cc | 17 ++++++++-------- .../ext/mt_allocator/deallocate_local-4.cc | 17 ++++++++-------- .../ext/mt_allocator/deallocate_local_thread-1.cc | 17 ++++++++-------- .../ext/mt_allocator/deallocate_local_thread-3.cc | 17 ++++++++-------- libstdc++-v3/testsuite/ext/mt_allocator/tune-3.cc | 2 +- libstdc++-v3/testsuite/ext/mt_allocator/tune-4.cc | 2 +- 10 files changed, 94 insertions(+), 70 deletions(-) (limited to 'libstdc++-v3/testsuite/ext/mt_allocator') diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-2.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-2.cc index 01baada5470..625cbc94cf1 100644 --- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-2.cc +++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-2.cc @@ -19,6 +19,7 @@ // 20.4.1.1 allocator members +#include #include #include #include @@ -31,13 +32,15 @@ struct count_check count_check() {} ~count_check() { -#ifdef _GLIBCXX_USE___CXA_ATEXIT if (count != 0) - throw std::exception(); -#endif + { + // NB: __mt_allocator doesn't clean itself up. Thus, this will + // not be zero. + } } }; +// First. static count_check check; void* operator new(size_t size) throw(std::bad_alloc) @@ -63,15 +66,17 @@ void operator delete(void* p) throw() free(p); } -typedef char char_t; -typedef std::char_traits traits_t; -typedef __gnu_cxx::__common_pool_policy pool_t; -typedef __gnu_cxx::__mt_alloc allocator_t; -typedef std::basic_string string_t; +typedef std::string value_t; +typedef __gnu_cxx::__common_pool_policy policy_t; +typedef __gnu_cxx::__mt_alloc allocator_t; +typedef std::char_traits traits_t; +typedef std::list list_t; -string_t s("bayou bend"); +// Second. +list_t l; int main() { + l.push_back("bayou bend"); return 0; } diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-4.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-4.cc index 3d5b96233f5..8d048bbeaaf 100644 --- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-4.cc +++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-4.cc @@ -19,6 +19,7 @@ // 20.4.1.1 allocator members +#include #include #include #include @@ -31,13 +32,15 @@ struct count_check count_check() {} ~count_check() { -#ifdef _GLIBCXX_USE___CXA_ATEXIT if (count != 0) - throw std::runtime_error("count isn't zero"); -#endif + { + // NB: __mt_allocator doesn't clean itself up. Thus, this will + // not be zero. + } } }; +// First. static count_check check; void* operator new(size_t size) throw(std::bad_alloc) @@ -63,15 +66,17 @@ void operator delete(void* p) throw() free(p); } -typedef char char_t; -typedef std::char_traits traits_t; -typedef __gnu_cxx::__per_type_pool_policy pool_t; -typedef __gnu_cxx::__mt_alloc allocator_t; -typedef std::basic_string string_t; +typedef std::string value_t; +typedef __gnu_cxx::__per_type_pool_policy policy_t; +typedef __gnu_cxx::__mt_alloc allocator_t; +typedef std::char_traits traits_t; +typedef std::list list_t; -string_t s("bayou bend"); +// Second. +list_t l; int main() { + l.push_back("bayou bend"); return 0; } diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-1.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-1.cc index 3ec3abcd6b6..0a6904171d0 100644 --- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-1.cc +++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-1.cc @@ -19,6 +19,7 @@ // 20.4.1.1 allocator members +#include #include #include #include @@ -31,13 +32,15 @@ struct count_check count_check() {} ~count_check() { -#ifdef _GLIBCXX_USE___CXA_ATEXIT if (count != 0) - throw std::runtime_error("count isn't zero"); -#endif + { + // NB: __mt_allocator doesn't clean itself up. Thus, this will + // not be zero. + } } }; +// First. static count_check check; void* operator new(size_t size) throw(std::bad_alloc) @@ -63,15 +66,17 @@ void operator delete(void* p) throw() free(p); } -typedef char char_t; -typedef std::char_traits traits_t; -typedef __gnu_cxx::__common_pool_policy pool_t; -typedef __gnu_cxx::__mt_alloc allocator_t; -typedef std::basic_string string_t; +typedef std::string value_t; +typedef __gnu_cxx::__common_pool_policy policy_t; +typedef __gnu_cxx::__mt_alloc allocator_t; +typedef std::char_traits traits_t; +typedef std::list list_t; -string_t s("bayou bend"); +// Second. +list_t l; int main() { + l.push_back("bayou bend"); return 0; } diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-3.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-3.cc index 398ef31d39d..d764d41c9a0 100644 --- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-3.cc +++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-3.cc @@ -19,6 +19,7 @@ // 20.4.1.1 allocator members +#include #include #include #include @@ -31,13 +32,15 @@ struct count_check count_check() {} ~count_check() { -#ifdef _GLIBCXX_USE___CXA_ATEXIT if (count != 0) - throw std::runtime_error("count isn't zero"); -#endif + { + // NB: __mt_allocator doesn't clean itself up. Thus, this will + // not be zero. + } } }; +// First. static count_check check; void* operator new(size_t size) throw(std::bad_alloc) @@ -63,15 +66,17 @@ void operator delete(void* p) throw() free(p); } -typedef char char_t; -typedef std::char_traits traits_t; -typedef __gnu_cxx::__per_type_pool_policy pool_t; -typedef __gnu_cxx::__mt_alloc allocator_t; -typedef std::basic_string string_t; +typedef std::string value_t; +typedef __gnu_cxx::__per_type_pool_policy policy_t; +typedef __gnu_cxx::__mt_alloc allocator_t; +typedef std::char_traits traits_t; +typedef std::list list_t; -string_t s("bayou bend"); +// Second. +list_t l; int main() { + l.push_back("bayou bend"); return 0; } diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-2.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-2.cc index b8e2784f484..ae1ca528ee0 100644 --- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-2.cc +++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-2.cc @@ -31,10 +31,11 @@ struct count_check count_check() {} ~count_check() { -#ifdef _GLIBCXX_USE___CXA_ATEXIT if (count != 0) - throw std::runtime_error("count isn't zero"); -#endif + { + // NB: __mt_allocator doesn't clean itself up. Thus, this will + // not be zero. + } } }; @@ -63,11 +64,11 @@ void operator delete(void* p) throw() free(p); } -typedef char char_t; -typedef std::char_traits traits_t; -typedef __gnu_cxx::__common_pool_policy pool_t; -typedef __gnu_cxx::__mt_alloc allocator_t; -typedef std::basic_string string_t; +typedef char value_t; +typedef std::char_traits traits_t; +typedef __gnu_cxx::__common_pool_policy policy_t; +typedef __gnu_cxx::__mt_alloc allocator_t; +typedef std::basic_string string_t; int main() { 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 1df7fb500cd..5321b8d61fa 100644 --- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-4.cc +++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-4.cc @@ -31,10 +31,11 @@ struct count_check count_check() {} ~count_check() { -#ifdef _GLIBCXX_USE___CXA_ATEXIT if (count != 0) - throw std::runtime_error("count isn't zero"); -#endif + { + // NB: __mt_allocator doesn't clean itself up. Thus, this will + // not be zero. + } } }; @@ -63,11 +64,11 @@ void operator delete(void* p) throw() free(p); } -typedef char char_t; -typedef std::char_traits traits_t; -typedef __gnu_cxx::__per_type_pool_policy pool_t; -typedef __gnu_cxx::__mt_alloc allocator_t; -typedef std::basic_string string_t; +typedef char value_t; +typedef std::char_traits traits_t; +typedef __gnu_cxx::__per_type_pool_policy policy_t; +typedef __gnu_cxx::__mt_alloc allocator_t; +typedef std::basic_string string_t; int main() { diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-1.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-1.cc index 2191264e942..0f3a57a4c8b 100644 --- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-1.cc +++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-1.cc @@ -31,10 +31,11 @@ struct count_check count_check() {} ~count_check() { -#ifdef _GLIBCXX_USE___CXA_ATEXIT if (count != 0) - throw std::runtime_error("count isn't zero"); -#endif + { + // NB: __mt_allocator doesn't clean itself up. Thus, this will + // not be zero. + } } }; @@ -63,11 +64,11 @@ void operator delete(void* p) throw() free(p); } -typedef char char_t; -typedef std::char_traits traits_t; -typedef __gnu_cxx::__common_pool_policy pool_t; -typedef __gnu_cxx::__mt_alloc allocator_t; -typedef std::basic_string string_t; +typedef char value_t; +typedef std::char_traits traits_t; +typedef __gnu_cxx::__common_pool_policy policy_t; +typedef __gnu_cxx::__mt_alloc allocator_t; +typedef std::basic_string string_t; int main() { diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-3.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-3.cc index 6094a718a0e..e293b5c5193 100644 --- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-3.cc +++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-3.cc @@ -31,10 +31,11 @@ struct count_check count_check() {} ~count_check() { -#ifdef _GLIBCXX_USE___CXA_ATEXIT if (count != 0) - throw std::runtime_error("count isn't zero"); -#endif + { + // NB: __mt_allocator doesn't clean itself up. Thus, this will + // not be zero. + } } }; @@ -63,11 +64,11 @@ void operator delete(void* p) throw() free(p); } -typedef char char_t; -typedef std::char_traits traits_t; -typedef __gnu_cxx::__per_type_pool_policy pool_t; -typedef __gnu_cxx::__mt_alloc allocator_t; -typedef std::basic_string string_t; +typedef char value_t; +typedef std::char_traits traits_t; +typedef __gnu_cxx::__per_type_pool_policy policy_t; +typedef __gnu_cxx::__mt_alloc allocator_t; +typedef std::basic_string string_t; int main() { diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/tune-3.cc b/libstdc++-v3/testsuite/ext/mt_allocator/tune-3.cc index c7049fc8e23..6e8098a609d 100644 --- a/libstdc++-v3/testsuite/ext/mt_allocator/tune-3.cc +++ b/libstdc++-v3/testsuite/ext/mt_allocator/tune-3.cc @@ -30,7 +30,7 @@ struct test_policy template struct test_policy<__gnu_cxx::__common_pool_policy<_Thread> > { - typedef __gnu_cxx::__common_pool_policy<_Thread> pool_type; + typedef __gnu_cxx::__common_pool_policy<_Thread> policy_type; static bool per_type() { return false; } }; diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/tune-4.cc b/libstdc++-v3/testsuite/ext/mt_allocator/tune-4.cc index 90c0c4a709c..993f7b3a52e 100644 --- a/libstdc++-v3/testsuite/ext/mt_allocator/tune-4.cc +++ b/libstdc++-v3/testsuite/ext/mt_allocator/tune-4.cc @@ -30,7 +30,7 @@ struct test_policy template struct test_policy<__gnu_cxx::__common_pool_policy<_Thread> > { - typedef __gnu_cxx::__common_pool_policy<_Thread> pool_type; + typedef __gnu_cxx::__common_pool_policy<_Thread> policy_type; static bool per_type() { return false; } }; -- cgit v1.2.1