This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] allocator deallocate null checks
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Thu, 14 Oct 2004 18:09:53 -0500
- Subject: [v3] allocator deallocate null checks
- Organization: Red Hat / Chicago
Sorry y'all, I managed to kill off the carefully prepared patch before
sending, in my haste to get to the GMT Oct 15 deadline. See:
http://gcc.gnu.org/ml/gcc-cvs/2004-10/msg00944.html
For the per-file diffs.
tested x86/linux
2004-10-14 Benjamin Kosnik <bkoz@redhat.com>
* include/ext/mt_allocator.h (__mt_alloc::deallocate): Check for
null pointer.
* include/ext/pool_allocator.h (debug_allocator::deallocate):
Check pointer value.
* include/ext/debug_allocator.h (debug_allocator::deallocate):
Throw exceptions, don't abort.
* include/ext/array_allocator.h
(array_allocator_base::deallocate): Remove unused parameters.
* testsuite/testsuite_allocator.h (check_deallocate_null): New.
* testsuite/ext/mt_allocator/check_deallocate_null.cc: New.
* testsuite/ext/mt_allocator/check_deallocate_null_thread.cc: New.
* testsuite/ext/array_allocator/check_deallocate_null.cc: New.
* testsuite/ext/debug_allocator/check_deallocate_null.cc: New.
* testsuite/ext/malloc_allocator/check_deallocate_null.cc: New.
* testsuite/ext/new_allocator/check_deallocate_null.cc: New.
* testsuite/ext/pool_allocator/check_deallocate_null.cc: New.
* testsuite/testsuite_allocator.h (check_new): Add instance argument.
* testsuite/ext/array_allocator/check_new.cc: New.