[libcxx] r328182 - Fix dynarray test failures after changing __libcpp_allocate/deallocate

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 21 22:44:48 PDT 2018


Author: ericwf
Date: Wed Mar 21 22:44:48 2018
New Revision: 328182

URL: http://llvm.org/viewvc/llvm-project?rev=328182&view=rev
Log:
Fix dynarray test failures after changing __libcpp_allocate/deallocate

Modified:
    libcxx/trunk/include/experimental/dynarray

Modified: libcxx/trunk/include/experimental/dynarray
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/dynarray?rev=328182&r1=328181&r2=328182&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/dynarray (original)
+++ libcxx/trunk/include/experimental/dynarray Wed Mar 21 22:44:48 2018
@@ -135,17 +135,18 @@ private:
     value_type *            __base_;
     _LIBCPP_ALWAYS_INLINE dynarray () noexcept :  __size_(0), __base_(nullptr) {}
     
-    static inline _LIBCPP_INLINE_VISIBILITY value_type* __allocate ( size_t count )
-    {
-        if ( numeric_limits<size_t>::max() / sizeof (value_type) <= count )
+    static inline _LIBCPP_INLINE_VISIBILITY
+    value_type* __allocate(size_t __count) {
+        if (numeric_limits<size_t>::max() / sizeof (value_type) <= __count)
             __throw_bad_array_length();
 
-        return static_cast<value_type *> (_VSTD::__allocate (sizeof(value_type) * count));
+        return static_cast<value_type *>(
+            _VSTD::__libcpp_allocate(sizeof(value_type) * __count, __alignof(value_type)));
     }
 
-    static inline _LIBCPP_INLINE_VISIBILITY void __deallocate_value( value_type* __ptr ) noexcept
-    {
-        _VSTD::__libcpp_deallocate (static_cast<void *> (__ptr));
+    static inline _LIBCPP_INLINE_VISIBILITY
+    void __deallocate_value(value_type* __ptr ) noexcept {
+        _VSTD::__libcpp_deallocate(static_cast<void *>(__ptr), __alignof(value_type));
     }
 
 public:




More information about the cfe-commits mailing list