aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <pcarlini@suse.de>2003-12-28 12:13:15 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2003-12-28 12:13:15 +0000
commitb8da67fa2f2d13121e6ea7500b6dd413efd99921 (patch)
tree27dc566b1a35f09df17779e46b2361e4da54a75a
parent920be544c9470f7606623a82b1ca8b5ace4d58cd (diff)
downloadgcc-b8da67fa2f2d13121e6ea7500b6dd413efd99921.zip
gcc-b8da67fa2f2d13121e6ea7500b6dd413efd99921.tar.gz
gcc-b8da67fa2f2d13121e6ea7500b6dd413efd99921.tar.bz2
pool_allocator.h (class __pool_alloc): Use operator new and operator delete.
2003-12-28 Paolo Carlini <pcarlini@suse.de> * include/ext/pool_allocator.h (class __pool_alloc): Use operator new and operator delete. From-SVN: r75181
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/include/ext/pool_allocator.h8
2 files changed, 9 insertions, 4 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 72cbfbb..dec3de6 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2003-12-28 Paolo Carlini <pcarlini@suse.de>
+
+ * include/ext/pool_allocator.h (class __pool_alloc): Use
+ operator new and operator delete.
+
2003-12-24 Andrew Pinski <pinskia@physics.uc.edu>
* config/cpu/i386/atomicity.h (__exchange_and_add): Fix output
diff --git a/libstdc++-v3/include/ext/pool_allocator.h b/libstdc++-v3/include/ext/pool_allocator.h
index cb2df02..02303de 100644
--- a/libstdc++-v3/include/ext/pool_allocator.h
+++ b/libstdc++-v3/include/ext/pool_allocator.h
@@ -200,7 +200,7 @@ namespace __gnu_cxx
((_Obj*)(void*)_S_start_free)->_M_free_list_link = *__free_list;
*__free_list = (_Obj*)(void*)_S_start_free;
}
- _S_start_free = new char[__bytes_to_get];
+ _S_start_free = static_cast<char*>(::operator new(__bytes_to_get));
if (_S_start_free == 0)
{
size_t __i;
@@ -225,7 +225,7 @@ namespace __gnu_cxx
}
}
_S_end_free = 0; // In case of exception.
- _S_start_free = new char[__bytes_to_get];
+ _S_start_free = static_cast<char*>(::operator new(__bytes_to_get));
// This should either throw an exception or remedy the situation.
// Thus we assume it succeeded.
}
@@ -290,7 +290,7 @@ namespace __gnu_cxx
}
if ((__n > (size_t) _S_max_bytes) || (_S_force_new > 0))
- __ret = new char[__n];
+ __ret = ::operator new(__n);
else
{
_Obj* volatile* __free_list = _S_free_list + _S_freelist_index(__n);
@@ -317,7 +317,7 @@ namespace __gnu_cxx
__pool_alloc<__threads, __inst>::deallocate(void* __p, size_t __n)
{
if ((__n > (size_t) _S_max_bytes) || (_S_force_new > 0))
- delete [] __p;
+ ::operator delete(__p);
else
{
_Obj* volatile* __free_list = _S_free_list + _S_freelist_index(__n);