aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <pcarlini@suse.de>2007-05-02 18:37:00 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2007-05-02 18:37:00 +0000
commitd4083c80e2c20796636f4b8b85b2b582efe9bb23 (patch)
tree2f5179f8d6109a50d4b421d6bfacc610e31ebf06
parentc5b75e95c0401ac670518c22761f1f34144a753b (diff)
downloadgcc-d4083c80e2c20796636f4b8b85b2b582efe9bb23.zip
gcc-d4083c80e2c20796636f4b8b85b2b582efe9bb23.tar.gz
gcc-d4083c80e2c20796636f4b8b85b2b582efe9bb23.tar.bz2
re PR libstdc++/31777 (GLIBCXX_FORCE_NEW doesn't always work in pool_allocator)
2007-05-02 Paolo Carlini <pcarlini@suse.de> PR libstdc++/31777 * include/ext/pool_allocator.h (__pool_alloc<>::allocate, __pool_alloc<>::deallocate): Fix _S_force_new check. From-SVN: r124355
-rw-r--r--libstdc++-v3/ChangeLog6
-rw-r--r--libstdc++-v3/include/ext/pool_allocator.h6
2 files changed, 9 insertions, 3 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index beb95cc..1aee8b0 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,9 @@
+2007-05-02 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/31777
+ * include/ext/pool_allocator.h (__pool_alloc<>::allocate,
+ __pool_alloc<>::deallocate): Fix _S_force_new check.
+
2007-05-01 Benjamin Kosnik <bkoz@redhat.com>
* 23_containers/requirements/sequences/dr438/deque/*: Move to...
diff --git a/libstdc++-v3/include/ext/pool_allocator.h b/libstdc++-v3/include/ext/pool_allocator.h
index e78bf21..f9dcc7f 100644
--- a/libstdc++-v3/include/ext/pool_allocator.h
+++ b/libstdc++-v3/include/ext/pool_allocator.h
@@ -1,6 +1,6 @@
// Allocators -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -212,7 +212,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
}
const size_t __bytes = __n * sizeof(_Tp);
- if (__bytes > size_t(_S_max_bytes) || _S_force_new == 1)
+ if (__bytes > size_t(_S_max_bytes) || _S_force_new > 0)
__ret = static_cast<_Tp*>(::operator new(__bytes));
else
{
@@ -241,7 +241,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
if (__builtin_expect(__n != 0 && __p != 0, true))
{
const size_t __bytes = __n * sizeof(_Tp);
- if (__bytes > static_cast<size_t>(_S_max_bytes) || _S_force_new == 1)
+ if (__bytes > static_cast<size_t>(_S_max_bytes) || _S_force_new > 0)
::operator delete(__p);
else
{