diff options
author | 2019-02-04 16:55:44 +0000 | |
---|---|---|
committer | 2019-02-04 16:55:44 +0000 | |
commit | 76c648e7a477ffb2a882ad5ffe523269bd9a3f6a (patch) | |
tree | 29d319d598650bab04e4f58e5e8769567e33091e /lib/libcxx/include/experimental/dynarray | |
parent | Import libc++abi 7.0.1. (diff) | |
download | wireguard-openbsd-76c648e7a477ffb2a882ad5ffe523269bd9a3f6a.tar.xz wireguard-openbsd-76c648e7a477ffb2a882ad5ffe523269bd9a3f6a.zip |
Import libc++ 7.0.1.
Diffstat (limited to 'lib/libcxx/include/experimental/dynarray')
-rw-r--r-- | lib/libcxx/include/experimental/dynarray | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/libcxx/include/experimental/dynarray b/lib/libcxx/include/experimental/dynarray index 16193317ad2..a60c87c3f97 100644 --- a/lib/libcxx/include/experimental/dynarray +++ b/lib/libcxx/include/experimental/dynarray @@ -133,19 +133,20 @@ public: private: size_t __size_; value_type * __base_; - _LIBCPP_ALWAYS_INLINE dynarray () noexcept : __size_(0), __base_(nullptr) {} + _LIBCPP_INLINE_VISIBILITY 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: |