From deb7e4e0095cedd4b8a918ff9693a5d8140b80b4 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Thu, 22 Mar 2018 05:44:48 +0000 Subject: [PATCH] Fix dynarray test failures after changing __libcpp_allocate/deallocate llvm-svn: 328182 --- libcxx/include/experimental/dynarray | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libcxx/include/experimental/dynarray b/libcxx/include/experimental/dynarray index 1619331..cebfc20 100644 --- a/libcxx/include/experimental/dynarray +++ b/libcxx/include/experimental/dynarray @@ -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::max() / sizeof (value_type) <= count ) + static inline _LIBCPP_INLINE_VISIBILITY + value_type* __allocate(size_t __count) { + if (numeric_limits::max() / sizeof (value_type) <= __count) __throw_bad_array_length(); - return static_cast (_VSTD::__allocate (sizeof(value_type) * count)); + return static_cast( + _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 (__ptr)); + static inline _LIBCPP_INLINE_VISIBILITY + void __deallocate_value(value_type* __ptr ) noexcept { + _VSTD::__libcpp_deallocate(static_cast(__ptr), __alignof(value_type)); } public: -- 2.7.4