This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] libstdc++/31777


Hi,

tested x86-linux, committed to mainline.

Paolo.

//////////////
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.
Index: include/ext/pool_allocator.h
===================================================================
--- include/ext/pool_allocator.h	(revision 124330)
+++ include/ext/pool_allocator.h	(working copy)
@@ -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 @@
 	    }
 
 	  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 @@
       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
 	    {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]