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: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: Gerald Pfeifer <gerald at pfeifer dot com>, Benjamin Kosnik <bkoz at redhat dot com>, libstdc++ at gcc dot gnu dot org
- Date: 26 Dec 2003 16:50:58 +0100
- Subject: Re: pool allocator changes and delete[] void*
- Organization: Integrable Solutions
- References: <Pine.BSF.4.58.0312261431490.49051@acrux.dbai.tuwien.ac.at><3FEC4816.70503@suse.de>
Paolo Carlini <pcarlini@suse.de> writes:
| 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);
Please don't write that. Say what you mean: Call the deallocation *function*
operator delete[] (p);
-- Gaby