diff --git a/include/dwarfs/entry.h b/include/dwarfs/entry.h index 254a2ae0..3df82d68 100644 --- a/include/dwarfs/entry.h +++ b/include/dwarfs/entry.h @@ -33,10 +33,9 @@ #include #include -#include - #include #include +#include namespace dwarfs { @@ -151,7 +150,7 @@ class file : public entry { private: struct data { - using hash_type = folly::small_vector; + using hash_type = small_vector; hash_type hash; uint32_t refcount{1}; std::optional inode_num; diff --git a/include/dwarfs/inode.h b/include/dwarfs/inode.h index 6dfdb94a..f093c735 100644 --- a/include/dwarfs/inode.h +++ b/include/dwarfs/inode.h @@ -28,11 +28,10 @@ #include #include -#include - #include #include #include +#include #include namespace dwarfs { @@ -50,7 +49,7 @@ struct inode_options; class inode : public object { public: - using files_vector = folly::small_vector; + using files_vector = small_vector; virtual void set_files(files_vector&& fv) = 0; virtual void populate(size_t size) = 0; diff --git a/include/dwarfs/inode_fragments.h b/include/dwarfs/inode_fragments.h index d23e71d6..db2f4f88 100644 --- a/include/dwarfs/inode_fragments.h +++ b/include/dwarfs/inode_fragments.h @@ -27,9 +27,8 @@ #include #include -#include - #include +#include #include #include @@ -57,7 +56,7 @@ class single_inode_fragment { private: fragment_category category_; file_off_t length_; - folly::small_vector chunks_; + small_vector chunks_; }; class inode_fragments { @@ -105,7 +104,7 @@ class inode_fragments { std::unordered_map get_category_sizes() const; private: - folly::small_vector fragments_; + small_vector fragments_; }; inline std::ostream& operator<<(std::ostream& os, inode_fragments const& frag) { diff --git a/include/dwarfs/iovec_read_buf.h b/include/dwarfs/iovec_read_buf.h index 1911f5cd..aabfc3ab 100644 --- a/include/dwarfs/iovec_read_buf.h +++ b/include/dwarfs/iovec_read_buf.h @@ -22,9 +22,9 @@ #pragma once #include -#include #include +#include namespace dwarfs { @@ -32,8 +32,8 @@ struct iovec_read_buf { // This covers more than 95% of reads static constexpr size_t inline_storage = 16; - folly::small_vector buf; - folly::small_vector ranges; + small_vector buf; + small_vector ranges; }; } // namespace dwarfs diff --git a/include/dwarfs/offset_cache.h b/include/dwarfs/offset_cache.h index eec8aa9d..426d7a2d 100644 --- a/include/dwarfs/offset_cache.h +++ b/include/dwarfs/offset_cache.h @@ -30,7 +30,8 @@ #include #include -#include + +#include namespace dwarfs { @@ -153,7 +154,7 @@ class basic_offset_cache { std::span offsets() const { return offsets_; } private: - folly::small_vector offsets_; + small_vector offsets_; chunk_index_type first_index_{0}; }; diff --git a/include/dwarfs/performance_monitor.h b/include/dwarfs/performance_monitor.h index ac953195..e80ec5a5 100644 --- a/include/dwarfs/performance_monitor.h +++ b/include/dwarfs/performance_monitor.h @@ -31,7 +31,7 @@ #include #include -#include +#include namespace dwarfs { @@ -95,7 +95,7 @@ class performance_monitor_proxy { performance_monitor::timer_id id_; performance_monitor::time_type start_; std::optional< - folly::small_vector> + small_vector> context_; }; diff --git a/include/dwarfs/small_vector.h b/include/dwarfs/small_vector.h new file mode 100644 index 00000000..ec2bb524 --- /dev/null +++ b/include/dwarfs/small_vector.h @@ -0,0 +1,33 @@ +/* vim:set ts=2 sw=2 sts=2 et: */ +/** + * \author Marcus Holland-Moritz (github@mhxnet.de) + * \copyright Copyright (c) Marcus Holland-Moritz + * + * This file is part of dwarfs. + * + * dwarfs is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * dwarfs is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with dwarfs. If not, see . + */ + +#pragma once + +#include +// #include + +namespace dwarfs { + +template +using small_vector = folly::small_vector; +// using small_vector = boost::container::small_vector; + +} // namespace dwarfs diff --git a/src/dwarfs/inode_manager.cpp b/src/dwarfs/inode_manager.cpp index 3643b40f..71d93e7e 100644 --- a/src/dwarfs/inode_manager.cpp +++ b/src/dwarfs/inode_manager.cpp @@ -39,7 +39,6 @@ #include #include -#include #include #include diff --git a/src/dwarfs/performance_monitor.cpp b/src/dwarfs/performance_monitor.cpp index 90559360..21351e65 100644 --- a/src/dwarfs/performance_monitor.cpp +++ b/src/dwarfs/performance_monitor.cpp @@ -137,7 +137,7 @@ class performance_monitor_impl : public performance_monitor { timer_id id; time_type start; time_type end; - folly::small_vector context; + small_vector context; }; explicit performance_monitor_impl(