summaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/include/experimental/memory_resource
diff options
context:
space:
mode:
authorarcadia-devtools <[email protected]>2022-02-10 17:53:52 +0300
committerarcadia-devtools <[email protected]>2022-02-10 17:53:52 +0300
commit5c64b97bb7e4034eff8833e4c367f61d34fcb4ee (patch)
tree7c5769528f2fcdaa5a718aa73e4aa64d50905269 /contrib/libs/cxxsupp/libcxx/include/experimental/memory_resource
parent1b56f620ac98766b198121ca1b728e7e61efbb56 (diff)
intermediate changes
ref:4635f4dd763168c3fa295f87727595c785b4d5a4
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include/experimental/memory_resource')
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/experimental/memory_resource14
1 files changed, 4 insertions, 10 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/memory_resource b/contrib/libs/cxxsupp/libcxx/include/experimental/memory_resource
index 816d21f5136..75e502d78c2 100644
--- a/contrib/libs/cxxsupp/libcxx/include/experimental/memory_resource
+++ b/contrib/libs/cxxsupp/libcxx/include/experimental/memory_resource
@@ -183,11 +183,8 @@ public:
// 8.6.3, memory.polymorphic.allocator.mem
_LIBCPP_INLINE_VISIBILITY
_ValueType* allocate(size_t __n) {
- if (__n > __max_size()) {
- __throw_length_error(
- "std::experimental::pmr::polymorphic_allocator<T>::allocate(size_t n)"
- " 'n' exceeds maximum supported size");
- }
+ if (__n > __max_size())
+ __throw_bad_array_new_length();
return static_cast<_ValueType*>(
__res_->allocate(__n * sizeof(_ValueType), _LIBCPP_ALIGNOF(_ValueType))
);
@@ -384,11 +381,8 @@ public:
private:
virtual void * do_allocate(size_t __bytes, size_t)
{
- if (__bytes > __max_size()) {
- __throw_length_error(
- "std::experimental::pmr::resource_adaptor<T>::do_allocate(size_t bytes, size_t align)"
- " 'bytes' exceeds maximum supported size");
- }
+ if (__bytes > __max_size())
+ __throw_bad_array_new_length();
size_t __s = __aligned_allocation_size(__bytes, _MaxAlign) / _MaxAlign;
return __alloc_.allocate(__s);
}