Skip to content

Commit

Permalink
[libc++] NFC: Synchronize libc++abi and libc++ new definitions
Browse files Browse the repository at this point in the history
Some changes were made to the libc++abi new/delete definitions, but
they were not copied back to the libc++ definition. It sucks that we
have this duplication, but for now at least let's keep them in sync.
  • Loading branch information
ldionne committed Nov 11, 2020
1 parent 7a70a2f commit d4a1e03
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libcxx/src/new.cpp
Expand Up @@ -130,7 +130,8 @@ _LIBCPP_WEAK
void
operator delete(void* ptr) _NOEXCEPT
{
::free(ptr);
if (ptr)
::free(ptr);
}

_LIBCPP_WEAK
Expand Down Expand Up @@ -251,10 +252,11 @@ _LIBCPP_WEAK
void
operator delete(void* ptr, std::align_val_t) _NOEXCEPT
{
if (ptr)
#if defined(_LIBCPP_MSVCRT_LIKE)
::_aligned_free(ptr);
::_aligned_free(ptr);
#else
::free(ptr);
::free(ptr);
#endif
}

Expand Down

0 comments on commit d4a1e03

Please sign in to comment.