[libcxx-commits] [libcxx] f23f299 - [libcxx] [test] Fix experimental/memory.resource.adaptor.mem/db_deallocate on Windows

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 16 13:02:55 PDT 2021


Author: Martin Storsjö
Date: 2021-07-16T23:02:47+03:00
New Revision: f23f299c046ca017a7cddc6fc290f26f9fe09064

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

LOG: [libcxx] [test] Fix experimental/memory.resource.adaptor.mem/db_deallocate on Windows

The checks within the libc++experimental memory_resource class uses this
limit:

     _MaxAlign = _LIBCPP_ALIGNOF(max_align_t);

Therefore, only use max_align_t for this limit instead of using
`__STDCPP_DEFAULT_NEW_ALIGNMENT__` if available.

Differential Revision: https://reviews.llvm.org/D105905

Added: 
    

Modified: 
    libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/db_deallocate.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/db_deallocate.pass.cpp b/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/db_deallocate.pass.cpp
index 109375b10e6e7..cbc1e26136993 100644
--- a/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/db_deallocate.pass.cpp
+++ b/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/db_deallocate.pass.cpp
@@ -14,8 +14,6 @@
 
 // T* polymorphic_allocator<T>::deallocate(T*, size_t size)
 
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
 int AssertCount = 0;
 
 #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (void)::AssertCount++)
@@ -38,13 +36,8 @@ int main(int, char**)
     ex::resource_adaptor<Alloc> r(Alloc{P});
     ex::memory_resource & m1 = r;
 
-#ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__
-    std::size_t maxSize = std::numeric_limits<std::size_t>::max()
-                            - __STDCPP_DEFAULT_NEW_ALIGNMENT__;
-#else
     std::size_t maxSize = std::numeric_limits<std::size_t>::max()
                             - alignof(std::max_align_t);
-#endif
 
     m1.deallocate(nullptr, maxSize);
     assert(AssertCount == 0);


        


More information about the libcxx-commits mailing list