[libcxx-commits] [PATCH] D118190: [libcxx] [test] Fix mismatches between _aligned_malloc and free() on Windows

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 26 01:53:20 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGa2aea7199a5c: [libcxx] [test] Fix mismatches between _aligned_malloc and free() on Windows (authored by mstorsjo).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118190/new/

https://reviews.llvm.org/D118190

Files:
  libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp


Index: libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
===================================================================
--- libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
+++ libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp
@@ -9,10 +9,6 @@
 // test libc++'s implementation of align_val_t, and the relevant new/delete
 // overloads in all dialects when -faligned-allocation is present.
 
-// Libc++ defers to the underlying MSVC library to provide the new/delete
-// definitions, which does not yet provide aligned allocation
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
 // XFAIL: LIBCXX-AIX-FIXME
 
 // The dylibs shipped before macosx10.13 do not contain the aligned allocation
@@ -115,14 +111,14 @@
 
 #ifndef NO_ALIGN
 void operator delete(void* p, std::align_val_t a)TEST_NOEXCEPT {
-  ::free(p);
+  std::__libcpp_aligned_free(p);
   stats.aligned_called++;
   stats.last_align = static_cast<int>(a);
   stats.last_size = -1;
 }
 
 void operator delete(void* p, size_t n, std::align_val_t a)TEST_NOEXCEPT {
-  ::free(p);
+  std::__libcpp_aligned_free(p);
   stats.aligned_sized_called++;
   stats.last_align = static_cast<int>(a);
   stats.last_size = n;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118190.403172.patch
Type: text/x-patch
Size: 1240 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220126/661a5b3c/attachment-0001.bin>


More information about the libcxx-commits mailing list