[libcxxabi] r302755 - Don't use posix_memalign under MinGW
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Wed May 10 19:01:05 PDT 2017
Author: ericwf
Date: Wed May 10 21:01:05 2017
New Revision: 302755
URL: http://llvm.org/viewvc/llvm-project?rev=302755&view=rev
Log:
Don't use posix_memalign under MinGW
Modified:
libcxxabi/trunk/src/stdlib_new_delete.cpp
Modified: libcxxabi/trunk/src/stdlib_new_delete.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/stdlib_new_delete.cpp?rev=302755&r1=302754&r2=302755&view=diff
==============================================================================
--- libcxxabi/trunk/src/stdlib_new_delete.cpp (original)
+++ libcxxabi/trunk/src/stdlib_new_delete.cpp Wed May 10 21:01:05 2017
@@ -146,7 +146,7 @@ operator new(std::size_t size, std::alig
if (static_cast<size_t>(alignment) < sizeof(void*))
alignment = std::align_val_t(sizeof(void*));
void* p;
-#if defined(_LIBCPP_MSVCRT)
+#if defined(_LIBCPP_WIN32API)
while ((p = _aligned_malloc(size, static_cast<size_t>(alignment))) == nullptr)
#else
while (::posix_memalign(&p, static_cast<size_t>(alignment), size) != 0)
@@ -219,7 +219,7 @@ void
operator delete(void* ptr, std::align_val_t) _NOEXCEPT
{
if (ptr)
-#if defined(_LIBCPP_MSVCRT)
+#if defined(_LIBCPP_WIN32API)
::_aligned_free(ptr);
#else
::free(ptr);
More information about the cfe-commits
mailing list