summaryrefslogtreecommitdiffstats
path: root/contrib/libc++/include/experimental/memory_resource
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libc++/include/experimental/memory_resource')
-rw-r--r--contrib/libc++/include/experimental/memory_resource17
1 files changed, 11 insertions, 6 deletions
diff --git a/contrib/libc++/include/experimental/memory_resource b/contrib/libc++/include/experimental/memory_resource
index b3d9ca8..d101f3e 100644
--- a/contrib/libc++/include/experimental/memory_resource
+++ b/contrib/libc++/include/experimental/memory_resource
@@ -82,6 +82,9 @@ namespace pmr {
#pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
// Round __s up to next multiple of __a.
@@ -181,7 +184,7 @@ public:
// 8.6.3, memory.polymorphic.allocator.mem
_LIBCPP_INLINE_VISIBILITY
_ValueType* allocate(size_t __n) {
- if (__n > max_size()) {
+ if (__n > __max_size()) {
__throw_length_error(
"std::experimental::pmr::polymorphic_allocator<T>::allocate(size_t n)"
" 'n' exceeds maximum supported size");
@@ -193,7 +196,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
void deallocate(_ValueType * __p, size_t __n) _NOEXCEPT {
- _LIBCPP_ASSERT(__n <= max_size(),
+ _LIBCPP_ASSERT(__n <= __max_size(),
"deallocate called for size which exceeds max_size()");
__res_->deallocate(__p, __n * sizeof(_ValueType), alignof(_ValueType));
}
@@ -266,10 +269,6 @@ public:
{ __p->~_Tp(); }
_LIBCPP_INLINE_VISIBILITY
- size_t max_size() const _NOEXCEPT
- { return numeric_limits<size_t>::max() / sizeof(value_type); }
-
- _LIBCPP_INLINE_VISIBILITY
polymorphic_allocator
select_on_container_copy_construction() const _NOEXCEPT
{ return polymorphic_allocator(); }
@@ -309,6 +308,10 @@ private:
return _Tup(_VSTD::get<_Idx>(_VSTD::move(__t))..., resource());
}
+ _LIBCPP_INLINE_VISIBILITY
+ size_t __max_size() const _NOEXCEPT
+ { return numeric_limits<size_t>::max() / sizeof(value_type); }
+
memory_resource * __res_;
};
@@ -419,4 +422,6 @@ using resource_adaptor = __resource_adaptor_imp<
_LIBCPP_END_NAMESPACE_LFTS_PMR
+_LIBCPP_POP_MACROS
+
#endif /* _LIBCPP_EXPERIMENTAL_MEMORY_RESOURCE */
OpenPOWER on IntegriCloud