Fix __hash_table::max_size() on 32 bit systems

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287749 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2016-11-23 09:16:12 +00:00
parent 80888fa0fe
commit e041941007
2 changed files with 3 additions and 3 deletions

View File

@@ -1005,8 +1005,7 @@ public:
size_type max_size() const _NOEXCEPT size_type max_size() const _NOEXCEPT
{ {
return std::min<size_type>( return std::min<size_type>(
allocator_traits<__pointer_allocator>::max_size( __node_traits::max_size(__node_alloc()),
__bucket_list_.get_deleter().__alloc()),
numeric_limits<difference_type >::max() numeric_limits<difference_type >::max()
); );
} }

View File

@@ -21,7 +21,8 @@
#include "test_macros.h" #include "test_macros.h"
template <class Alloc> template <class Alloc>
inline size_t alloc_max_size(Alloc const &a) { inline typename std::allocator_traits<Alloc>::size_type
alloc_max_size(Alloc const &a) {
typedef std::allocator_traits<Alloc> AT; typedef std::allocator_traits<Alloc> AT;
return AT::max_size(a); return AT::max_size(a);
} }