Remove redundant null pointer check in operator delete
C89 4.10.3.2 The free function
C99 7.20.3.2 The free function
C11 7.22.3.3 The free function
If ptr is a null pointer, no action shall occur.
_aligned_free on MSDN:
If memblock is a NULL pointer, this function simply performs no actions.
Reviewers: EricWF, mclow.lists
Subscribers: christof, ldionne, cfe-commits, libcxx-commits
Differential Revision: https://reviews.llvm.org/D52401
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342936 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -135,7 +135,6 @@ _LIBCPP_WEAK
|
|||||||
void
|
void
|
||||||
operator delete(void* ptr) _NOEXCEPT
|
operator delete(void* ptr) _NOEXCEPT
|
||||||
{
|
{
|
||||||
if (ptr)
|
|
||||||
::free(ptr);
|
::free(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,7 +256,6 @@ _LIBCPP_WEAK
|
|||||||
void
|
void
|
||||||
operator delete(void* ptr, std::align_val_t) _NOEXCEPT
|
operator delete(void* ptr, std::align_val_t) _NOEXCEPT
|
||||||
{
|
{
|
||||||
if (ptr)
|
|
||||||
#if defined(_LIBCPP_MSVCRT_LIKE)
|
#if defined(_LIBCPP_MSVCRT_LIKE)
|
||||||
::_aligned_free(ptr);
|
::_aligned_free(ptr);
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user