forked from OSchip/llvm-project
[libc++/abi] Re-remove unnecessary null pointer checks from operator delete
In7cd67904f7
, we removed the unnecessary nullptr checks from the libc++abi definition of operator delete, but we forgot to update the definition in libc++ (damn code duplication!). Then, ind4a1e03c5f
, I synced the definitions across libc++ and libc++abi, but I did it the wrong way around. I re-added the if() checks to libc++abi instead of removing them from libc++. Inef74f0fdc3
, we re-removed the if() check from operator delete, but only in libc++abi. This patch corrects this mess and removes it consistently in libc++ and libc++abi. Differential Revision: https://reviews.llvm.org/D93473
This commit is contained in:
parent
78b3bce23b
commit
bc556e5685
|
@ -130,8 +130,7 @@ _LIBCPP_WEAK
|
|||
void
|
||||
operator delete(void* ptr) _NOEXCEPT
|
||||
{
|
||||
if (ptr)
|
||||
::free(ptr);
|
||||
::free(ptr);
|
||||
}
|
||||
|
||||
_LIBCPP_WEAK
|
||||
|
@ -252,9 +251,7 @@ _LIBCPP_WEAK
|
|||
void
|
||||
operator delete(void* ptr, std::align_val_t) _NOEXCEPT
|
||||
{
|
||||
if (ptr) {
|
||||
std::__libcpp_aligned_free(ptr);
|
||||
}
|
||||
std::__libcpp_aligned_free(ptr);
|
||||
}
|
||||
|
||||
_LIBCPP_WEAK
|
||||
|
|
|
@ -214,9 +214,7 @@ _LIBCXXABI_WEAK
|
|||
void
|
||||
operator delete(void* ptr, std::align_val_t) _NOEXCEPT
|
||||
{
|
||||
if (ptr) {
|
||||
std::__libcpp_aligned_free(ptr);
|
||||
}
|
||||
std::__libcpp_aligned_free(ptr);
|
||||
}
|
||||
|
||||
_LIBCXXABI_WEAK
|
||||
|
|
Loading…
Reference in New Issue