diff --git a/libcxx/src/new.cpp b/libcxx/src/new.cpp index 782aac90fb7a..2ef8939fdcb3 100644 --- a/libcxx/src/new.cpp +++ b/libcxx/src/new.cpp @@ -198,7 +198,11 @@ void operator delete(void* ptr, std::align_val_t) _NOEXCEPT { if (ptr) +#if defined(_LIBCPP_MSVCRT) + ::_aligned_free(ptr); +#else ::free(ptr); +#endif } _LIBCPP_WEAK