]> gcc.gnu.org Git - gcc.git/commitdiff
hashtable_policy.h (_Prime_rehash_policy:: _M_next_bkt, [...]): Use __builtin_ceil.
authorPaolo Carlini <pcarlini@suse.de>
Mon, 24 Dec 2007 14:32:21 +0000 (14:32 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 24 Dec 2007 14:32:21 +0000 (14:32 +0000)
2007-12-24  Paolo Carlini  <pcarlini@suse.de>

* include/tr1_impl/hashtable_policy.h (_Prime_rehash_policy::
_M_next_bkt, _M_bkt_for_elements, _M_need_rehash): Use __builtin_ceil.
* include/std/unordered_map: Do not include <cmath>; prefer
<bits/stringfwd.h> to <string>.
* include/std/unordered_set: Likewise.
* include/tr1/unordered_map: Likewise.
* include/tr1/unordered_set: Likewise.

From-SVN: r131157

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/unordered_map
libstdc++-v3/include/std/unordered_set
libstdc++-v3/include/tr1/unordered_map
libstdc++-v3/include/tr1/unordered_set
libstdc++-v3/include/tr1_impl/hashtable_policy.h

index c058ac73a85ae069ea71bc95089aeadb08a2da86..99da8b588154d012daa61710870765e1e798213f 100644 (file)
@@ -1,3 +1,13 @@
+2007-12-24  Paolo Carlini  <pcarlini@suse.de>
+
+       * include/tr1_impl/hashtable_policy.h (_Prime_rehash_policy::
+       _M_next_bkt, _M_bkt_for_elements, _M_need_rehash): Use __builtin_ceil.
+       * include/std/unordered_map: Do not include <cmath>; prefer
+       <bits/stringfwd.h> to <string>.
+       * include/std/unordered_set: Likewise.
+       * include/tr1/unordered_map: Likewise.
+       * include/tr1/unordered_set: Likewise.
+
 2007-12-24  Paolo Carlini  <pcarlini@suse.de>
 
        * include/std/complex (complex<float>::complex(float, float)):
index 226fea8b106685aa2e82e2c7b89850c497a80bad..4ce80514d686a2ce793577c3d31b700c2b8beea2 100644 (file)
 #  error C++0x header cannot be included from TR1 header
 #endif
 
-#include <cmath>
-#include <string>
 #include <utility>
 #include <algorithm> // lower_bound
+#include <type_traits>
 #include <bits/allocator.h>
 #include <bits/stl_function.h> // equal_to, _Identity, _Select1st
-#include <type_traits>
+#include <bits/stringfwd.h>
 #include <bits/functional_hash.h>
 #include <bits/hashtable.h>
 
index 3b0f22c341896861328e4efb201440ccc39d7874..3cc69372b6f74550cd1556e674d51f48ecb34814 100644 (file)
 #  error C++0x header cannot be included from TR1 header
 #endif
 
-#include <cmath>
-#include <string>
 #include <utility>
 #include <algorithm> // lower_bound
+#include <type_traits>
 #include <bits/allocator.h>
 #include <bits/stl_function.h> // equal_to, _Identity, _Select1st
-#include <type_traits>
+#include <bits/stringfwd.h>
 #include <bits/functional_hash.h>
 #include <bits/hashtable.h>
 
index 85e8f0015c475c756116a4994b12baa87d5e4d13..041eb9443cf8b4802cde2ae85127896604453811 100644 (file)
 #  error TR1 header cannot be included from C++0x header
 #endif
 
-#include <cmath>
-#include <string>
 #include <utility>
 #include <algorithm> // lower_bound
 #include <bits/allocator.h>
 #include <bits/stl_function.h> // equal_to, _Identity, _Select1st
+#include <bits/stringfwd.h>
 #include <tr1/type_traits>
 #include <tr1/functional_hash.h>
 #include <tr1/hashtable.h>
index 35c605ff681b376ada9fffbb1b8f8683deb90629..16181681f557f5d602b293c255365057542523db 100644 (file)
 #  error TR1 header cannot be included from C++0x header
 #endif
 
-#include <cmath>
-#include <string>
 #include <utility>
 #include <algorithm> // lower_bound
 #include <bits/allocator.h>
 #include <bits/stl_function.h> // equal_to, _Identity, _Select1st
+#include <bits/stringfwd.h>
 #include <tr1/type_traits>
 #include <tr1/functional_hash.h>
 #include <tr1/hashtable.h>
index 514d444420eb395964f1b6df7bbebc1f787a723b..b74531c2ddf8e2179a069cca50f8521d5ea43a2a 100644 (file)
@@ -425,8 +425,8 @@ namespace __detail
   {
     const unsigned long* __p = std::lower_bound(__prime_list, __prime_list
                                                + _S_n_primes, __n);
-    _M_next_resize = static_cast<std::size_t>(std::ceil(*__p
-                                                       * _M_max_load_factor));
+    _M_next_resize = 
+      static_cast<std::size_t>(__builtin_ceil(*__p * _M_max_load_factor));
     return *__p;
   }
 
@@ -439,8 +439,8 @@ namespace __detail
     const float __min_bkts = __n / _M_max_load_factor;
     const unsigned long* __p = std::lower_bound(__prime_list, __prime_list
                                                + _S_n_primes, __min_bkts);
-    _M_next_resize = static_cast<std::size_t>(std::ceil(*__p
-                                                       * _M_max_load_factor));
+    _M_next_resize =
+      static_cast<std::size_t>(__builtin_ceil(*__p * _M_max_load_factor));
     return *__p;
   }
 
@@ -468,15 +468,14 @@ namespace __detail
            const unsigned long* __p =
              std::lower_bound(__prime_list, __prime_list + _S_n_primes,
                               __min_bkts);
-           _M_next_resize =
-             static_cast<std::size_t>(std::ceil(*__p * _M_max_load_factor));
+           _M_next_resize = static_cast<std::size_t>
+             (__builtin_ceil(*__p * _M_max_load_factor));
            return std::make_pair(true, *__p);
          }
        else 
          {
-           _M_next_resize =
-             static_cast<std::size_t>(std::ceil(__n_bkt
-                                                * _M_max_load_factor));
+           _M_next_resize = static_cast<std::size_t>
+             (__builtin_ceil(__n_bkt * _M_max_load_factor));
            return std::make_pair(false, 0);
          }
       }
This page took 0.071292 seconds and 5 git commands to generate.