[libcxx] r287749 - Fix __hash_table::max_size() on 32 bit systems

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 23 01:16:13 PST 2016


Author: ericwf
Date: Wed Nov 23 03:16:12 2016
New Revision: 287749

URL: http://llvm.org/viewvc/llvm-project?rev=287749&view=rev
Log:
Fix __hash_table::max_size() on 32 bit systems

Modified:
    libcxx/trunk/include/__hash_table
    libcxx/trunk/test/support/test_allocator.h

Modified: libcxx/trunk/include/__hash_table
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__hash_table?rev=287749&r1=287748&r2=287749&view=diff
==============================================================================
--- libcxx/trunk/include/__hash_table (original)
+++ libcxx/trunk/include/__hash_table Wed Nov 23 03:16:12 2016
@@ -1005,8 +1005,7 @@ public:
     size_type max_size() const _NOEXCEPT
     {
         return std::min<size_type>(
-            allocator_traits<__pointer_allocator>::max_size(
-              __bucket_list_.get_deleter().__alloc()),
+            __node_traits::max_size(__node_alloc()),
             numeric_limits<difference_type >::max()
         );
     }

Modified: libcxx/trunk/test/support/test_allocator.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/test_allocator.h?rev=287749&r1=287748&r2=287749&view=diff
==============================================================================
--- libcxx/trunk/test/support/test_allocator.h (original)
+++ libcxx/trunk/test/support/test_allocator.h Wed Nov 23 03:16:12 2016
@@ -21,7 +21,8 @@
 #include "test_macros.h"
 
 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;
   return AT::max_size(a);
 }




More information about the cfe-commits mailing list