diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2009-05-22 01:28:50 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2009-05-22 01:28:50 +0000 |
commit | e2792913bd05564861383c3934b9a327703f6db2 (patch) | |
tree | 2f0827a0613d8533f5adbd20c0a3a92c240297f9 /libstdc++-v3/src | |
parent | e0d0bf47c9f64ad592b0f47d572f1c76aab243cc (diff) | |
download | gcc-e2792913bd05564861383c3934b9a327703f6db2.zip gcc-e2792913bd05564861383c3934b9a327703f6db2.tar.gz gcc-e2792913bd05564861383c3934b9a327703f6db2.tar.bz2 |
re PR libstdc++/40094 (FAIL: ext/throw_allocator/deallocate_global.cc execution test)
2009-05-21 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/40094
Revert:
2009-05-07 Paolo Carlini <paolo.carlini@oracle.com>
* include/ext/throw_allocator.h (throw_allocator_base): Avoid
out of line member functions definitions.
(throw_allocator_base::_S_g, _S_map, _S_throw_prob, _S_label):
Remove, use static locals instead.
(throw_allocator_base::do_check_allocated, print_to_string): Declare.
* src/throw_allocator.cc: New.
* src/Makefile.am: Add.
* config/abi/pre/gnu.ver: Add exports.
* src/Makefile.in: Regenerate.
From-SVN: r147788
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r-- | libstdc++-v3/src/Makefile.am | 1 | ||||
-rw-r--r-- | libstdc++-v3/src/Makefile.in | 20 | ||||
-rw-r--r-- | libstdc++-v3/src/throw_allocator.cc | 95 |
3 files changed, 9 insertions, 107 deletions
diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am index 288243a..d218cea 100644 --- a/libstdc++-v3/src/Makefile.am +++ b/libstdc++-v3/src/Makefile.am @@ -182,7 +182,6 @@ sources = \ streambuf-inst.cc \ streambuf.cc \ string-inst.cc \ - throw_allocator.cc \ valarray-inst.cc \ wlocale-inst.cc \ wstring-inst.cc \ diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in index 24187af..9ee5275 100644 --- a/libstdc++-v3/src/Makefile.in +++ b/libstdc++-v3/src/Makefile.in @@ -85,13 +85,12 @@ am__libstdc___la_SOURCES_DIST = atomic.cc bitmap_allocator.cc \ fstream-inst.cc ext-inst.cc ios-inst.cc iostream-inst.cc \ istream-inst.cc istream.cc locale-inst.cc misc-inst.cc \ ostream-inst.cc sstream-inst.cc streambuf-inst.cc streambuf.cc \ - string-inst.cc throw_allocator.cc valarray-inst.cc \ - wlocale-inst.cc wstring-inst.cc mutex.cc condition_variable.cc \ - chrono.cc thread.cc atomicity.cc codecvt_members.cc \ - collate_members.cc ctype_members.cc messages_members.cc \ - monetary_members.cc numeric_members.cc time_members.cc \ - basic_file.cc c++locale.cc compatibility-ldbl.cc \ - parallel_list.cc parallel_settings.cc + string-inst.cc valarray-inst.cc wlocale-inst.cc \ + wstring-inst.cc mutex.cc condition_variable.cc chrono.cc \ + thread.cc atomicity.cc codecvt_members.cc collate_members.cc \ + ctype_members.cc messages_members.cc monetary_members.cc \ + numeric_members.cc time_members.cc basic_file.cc c++locale.cc \ + compatibility-ldbl.cc parallel_list.cc parallel_settings.cc am__objects_1 = atomicity.lo codecvt_members.lo collate_members.lo \ ctype_members.lo messages_members.lo monetary_members.lo \ numeric_members.lo time_members.lo @@ -112,9 +111,9 @@ am__objects_5 = atomic.lo bitmap_allocator.lo pool_allocator.lo \ fstream-inst.lo ext-inst.lo ios-inst.lo iostream-inst.lo \ istream-inst.lo istream.lo locale-inst.lo misc-inst.lo \ ostream-inst.lo sstream-inst.lo streambuf-inst.lo streambuf.lo \ - string-inst.lo throw_allocator.lo valarray-inst.lo \ - wlocale-inst.lo wstring-inst.lo mutex.lo condition_variable.lo \ - chrono.lo thread.lo $(am__objects_1) $(am__objects_4) + string-inst.lo valarray-inst.lo wlocale-inst.lo \ + wstring-inst.lo mutex.lo condition_variable.lo chrono.lo \ + thread.lo $(am__objects_1) $(am__objects_4) am_libstdc___la_OBJECTS = $(am__objects_5) libstdc___la_OBJECTS = $(am_libstdc___la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) @@ -435,7 +434,6 @@ sources = \ streambuf-inst.cc \ streambuf.cc \ string-inst.cc \ - throw_allocator.cc \ valarray-inst.cc \ wlocale-inst.cc \ wstring-inst.cc \ diff --git a/libstdc++-v3/src/throw_allocator.cc b/libstdc++-v3/src/throw_allocator.cc index a8247ad..e69de29 100644 --- a/libstdc++-v3/src/throw_allocator.cc +++ b/libstdc++-v3/src/throw_allocator.cc @@ -1,95 +0,0 @@ -// Throw Allocator. Out of line function definitions. -*- C++ -*- - -// Copyright (C) 2009 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 -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. - -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// <http://www.gnu.org/licenses/>. - -#include <ext/throw_allocator.h> - -_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) - - void - throw_allocator_base::do_check_allocated(const_iterator found, - const_iterator end, - void* p, size_t size) - { - if (found == end) - { - std::string error("throw_allocator_base::check_allocated by value " - "null erase!\n"); - print_to_string(error, make_entry(p, size)); - std::__throw_logic_error(error.c_str()); - } - - if (found->second.second != size) - { - std::string error("throw_allocator_base::check_allocated by value " - "wrong-size erase!\n"); - print_to_string(error, make_entry(p, size)); - print_to_string(error, *found); - std::__throw_logic_error(error.c_str()); - } - } - - void - throw_allocator_base::do_check_allocated(const_iterator beg, - const_iterator end, - size_t label) - { - std::string found; - while (beg != end) - { - if (beg->second.first == label) - print_to_string(found, *beg); - ++beg; - } - - if (!found.empty()) - { - std::string error("throw_allocator_base::check_allocated by label \n"); - error += found; - std::__throw_logic_error(error.c_str()); - } - } - - void - throw_allocator_base::print_to_string(std::string& s, - const_reference ref) - { - char buf[40]; - const char tab('\t'); - s += "address: "; - __builtin_sprintf(buf, "%p", ref.first); - s += buf; - s += tab; - s += "label: "; - unsigned long l = static_cast<unsigned long>(ref.second.first); - __builtin_sprintf(buf, "%lu", l); - s += buf; - s += tab; - s += "size: "; - l = static_cast<unsigned long>(ref.second.second); - __builtin_sprintf(buf, "%lu", l); - s += buf; - s += '\n'; - } - -_GLIBCXX_END_NAMESPACE |