This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: pool allocator changes and delete[] void*
- From: Paolo Carlini <pcarlini at suse dot de>
- To: Gerald Pfeifer <gerald at pfeifer dot com>
- Cc: Benjamin Kosnik <bkoz at redhat dot com>, libstdc++ at gcc dot gnu dot org
- Date: Fri, 26 Dec 2003 15:39:18 +0100
- Subject: Re: pool allocator changes and delete[] void*
- References: <Pine.BSF.4.58.0312261431490.49051@acrux.dbai.tuwien.ac.at>
Gerald Pfeifer wrote:
I'm afraid the recent pool allocator changes are causing troubles (or
at least tons of warnings):
/gcc-current/bin/../lib/gcc/$platform/3.4.0/../../../../
include/c++/3.4.0/ext/pool_allocator.h:320:
warning: deleting `void*' is undefined
Right Gerald. Please consider that this is work in progress: at least the
signature of __pool_alloc::deallocate should be changed, consistently with
that prescribed for class allocator by the Standard (20.4.1).
For now, I think you can safely suppress annoying warnings with
the attached.
Paolo.
//////////
--- pool_allocator.h.orig 2003-12-26 15:05:17.000000000 +0100
+++ pool_allocator.h 2003-12-26 15:22:51.000000000 +0100
@@ -317,7 +317,7 @@
__pool_alloc<__threads, __inst>::deallocate(void* __p, size_t __n)
{
if ((__n > (size_t) _S_max_bytes) || (_S_force_new > 0))
- delete [] __p;
+ delete [] static_cast<char*>(__p);
else
{
_Obj* volatile* __free_list = _S_free_list + _S_freelist_index(__n);