diff options
author | Nathan Sidwell <nathan@acm.org> | 2000-01-29 16:25:37 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2000-01-29 16:25:37 +0000 |
commit | 97119bb74455fe3c4131975c1230dbffdf2aee40 (patch) | |
tree | 6b946bc9c374de94d2ca92e715ea07f2493a4518 | |
parent | 02fed91d67d183ed5149552b7a1c591e2b7fcfb5 (diff) | |
download | gcc-97119bb74455fe3c4131975c1230dbffdf2aee40.zip gcc-97119bb74455fe3c4131975c1230dbffdf2aee40.tar.gz gcc-97119bb74455fe3c4131975c1230dbffdf2aee40.tar.bz2 |
new2.cc (operator delete[]): Use operator delete, don't assume implementation.
* new2.cc (operator delete[]): Use operator delete, don't assume
implementation.
From-SVN: r31687
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/new2.cc | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 18b573e..7b0c383 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2000-01-29 Nathan Sidwell <nathan@acm.org> + + * new2.cc (operator delete[]): Use operator delete, don't assume + implementation. + 2000-01-29 Nathan Sidwell <sidwell@codesourcery.com> * class.c (build_vtbl_initializer): Add argument to diff --git a/gcc/cp/new2.cc b/gcc/cp/new2.cc index d1aab7b..182b2d1 100644 --- a/gcc/cp/new2.cc +++ b/gcc/cp/new2.cc @@ -1,5 +1,5 @@ // Boilerplate support routines for -*- C++ -*- dynamic memory management. -// Copyright (C) 1997, 1998, 1999 Free Software Foundation +// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation // This file is part of GNU CC. @@ -58,8 +58,7 @@ WEAK (void operator delete (void *ptr) throw ()) #ifdef L_op_vdel WEAK (void operator delete[] (void *ptr) throw ()) { - if (ptr) - free (ptr); + ::operator delete (ptr); } #endif @@ -74,7 +73,6 @@ WEAK (void operator delete (void *ptr, const std::nothrow_t&) throw ()) #ifdef L_op_vdelnt WEAK (void operator delete[] (void *ptr, const std::nothrow_t&) throw ()) { - if (ptr) - free (ptr); + ::operator delete (ptr); } #endif |