]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson: do not use small_vector
authorKefu Chai <kchai@redhat.com>
Mon, 23 Dec 2019 09:57:06 +0000 (17:57 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 23 Dec 2019 17:22:07 +0000 (01:22 +0800)
if `std::is_nothrow_move_constructible<small_vector<peer_shard_t, 2>>`
also depends on if the allocator throws when moving from a small_vector
to a new one, as we need to allocate memory for the destination
small_vector.

so, in this change, the optimization for small_vector is dropped,
because the default allocator used by small_vector throws.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/osd/acked_peers.h

index 9969766ea0247a48368243ad3f78280d45117e66..b2f2562c0bca2b494c4289b5d72ade227a97edb0 100644 (file)
@@ -3,23 +3,12 @@
 
 #pragma once
 
-#include <boost/version.hpp>
-#if BOOST_VERSION >= 106900
-#include <boost/container/small_vector.hpp>
-#else
 #include <vector>
-#endif
 
 namespace crimson::osd {
   struct peer_shard_t {
     pg_shard_t shard;
     eversion_t last_complete_ondisk;
   };
-#if BOOST_VERSION >= 106900
-  // small_vector is is_nothrow_move_constructible<> since 1.69
-  // 2 + 1 = 3, which is the default value of "osd_pool_default_size"
-  using acked_peers_t = boost::container::small_vector<peer_shard_t, 2>;
-#else
   using acked_peers_t = std::vector<peer_shard_t>;
-#endif
 }