[libcxx-commits] [libcxxabi] d67e58f - [libc++abi] Don't try calling __libcpp_aligned_free when aligned allocation is disabled

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 1 14:45:24 PST 2020


Author: Louis Dionne
Date: 2020-12-01T17:45:14-05:00
New Revision: d67e58f23a8232ee17dba3cd8c5b4c1378ddbc59

URL: https://github.com/llvm/llvm-project/commit/d67e58f23a8232ee17dba3cd8c5b4c1378ddbc59
DIFF: https://github.com/llvm/llvm-project/commit/d67e58f23a8232ee17dba3cd8c5b4c1378ddbc59.diff

LOG: [libc++abi] Don't try calling __libcpp_aligned_free when aligned allocation is disabled

See https://reviews.llvm.org/rGa78aaa1ad512#962077 for details.

Added: 
    

Modified: 
    libcxxabi/src/fallback_malloc.cpp

Removed: 
    


################################################################################
diff  --git a/libcxxabi/src/fallback_malloc.cpp b/libcxxabi/src/fallback_malloc.cpp
index 78720187affc..f3d7937793ce 100644
--- a/libcxxabi/src/fallback_malloc.cpp
+++ b/libcxxabi/src/fallback_malloc.cpp
@@ -234,7 +234,11 @@ void __aligned_free_with_fallback(void* ptr) {
   if (is_fallback_ptr(ptr))
     fallback_free(ptr);
   else {
+#if defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)
+    ::free(ptr);
+#else
     std::__libcpp_aligned_free(ptr);
+#endif
   }
 }
 


        


More information about the libcxx-commits mailing list