From: Francesco Chemolli Date: Thu, 6 Sep 2018 15:24:37 +0000 (+0000) Subject: Remove non-standard, redundant new/delete operator replacements (#283) X-Git-Tag: M-staged-PR164~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bcfad5990464b235a8ba0a33ea44fa9f92856354;p=thirdparty%2Fsquid.git Remove non-standard, redundant new/delete operator replacements (#283) This change also fixes icc builds: Commit 39cca4e missed noexcept specification for nothrow variants of new and delete operators, and the icc compiler did not like that. Furthermore, we can simplify the replacements because, according to cppreference, with C++11, "replacing the throwing single object allocation functions is sufficient to handle all [allocations and deallocations]". --- diff --git a/src/SquidNew.cc b/src/SquidNew.cc index 8fff71854c..d64c254b35 100644 --- a/src/SquidNew.cc +++ b/src/SquidNew.cc @@ -22,31 +22,6 @@ void operator delete(void *address) { xfree(address); } -void *operator new[](size_t size) -{ - return xmalloc(size); -} -void operator delete[](void *address) -{ - xfree(address); -} - -void *operator new(size_t size, const std::nothrow_t &tag) -{ - return xmalloc(size); -} -void operator delete(void *address, const std::nothrow_t &tag) -{ - xfree(address); -} -void *operator new[](size_t size, const std::nothrow_t &tag) -{ - return xmalloc(size); -} -void operator delete[](void *address, const std::nothrow_t &tag) -{ - xfree(address); -} #endif /* !defined(__clang__) */