]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Remove non-standard, redundant new/delete operator replacements (#283)
authorFrancesco Chemolli <kinkie@squid-cache.org>
Thu, 6 Sep 2018 15:24:37 +0000 (15:24 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Thu, 6 Sep 2018 19:10:33 +0000 (19:10 +0000)
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]".

src/SquidNew.cc

index 8fff71854c205c16e7d57ea2d8bb2d6b9f1e7ce3..d64c254b35cff9a9137675ff0c85e23b1e6751b5 100644 (file)
@@ -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__) */