summaryrefslogtreecommitdiff
path: root/src/buildtool/storage/compactifier.hpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-04-02 18:37:16 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-04-17 11:04:08 +0200
commitb88adc43bb6ffe914ca9303e3001624e36fd64fa (patch)
tree845fd9e4c746ae9b86679a0ec21640cccfeea825 /src/buildtool/storage/compactifier.hpp
parentd9bf1d63768f1c3d660c3057d6d77c9b3b4a346d (diff)
downloadjustbuild-b88adc43bb6ffe914ca9303e3001624e36fd64fa.tar.gz
Compactification: Split large entries.
During garbage collection split and remove from the storage every entry that is larger than a threshold.
Diffstat (limited to 'src/buildtool/storage/compactifier.hpp')
-rw-r--r--src/buildtool/storage/compactifier.hpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/buildtool/storage/compactifier.hpp b/src/buildtool/storage/compactifier.hpp
index ced458fe..b8040b51 100644
--- a/src/buildtool/storage/compactifier.hpp
+++ b/src/buildtool/storage/compactifier.hpp
@@ -15,6 +15,8 @@
#ifndef INCLUDED_SRC_BUILDTOOL_STORAGE_COMPACTIFIER_HPP
#define INCLUDED_SRC_BUILDTOOL_STORAGE_COMPACTIFIER_HPP
+#include <cstddef>
+
template <bool>
class LocalCAS;
@@ -26,6 +28,16 @@ class Compactifier final {
/// entries.
[[nodiscard]] static auto RemoveSpliced(LocalCAS<false> const& cas) noexcept
-> bool;
+
+ /// \brief Split and remove from the storage every entry that is larger than
+ /// the compactification threshold. Results of splitting are added to the
+ /// LocalCAS.
+ /// \param local_cas LocalCAS to store results of splitting.
+ /// \param threshold Compactification threshold.
+ /// \return True if the storage doesn't contain splitable
+ /// entries larger than the compactification threshold afterwards.
+ [[nodiscard]] static auto SplitLarge(LocalCAS<false> const& cas,
+ size_t threshold) noexcept -> bool;
};
#endif // INCLUDED_SRC_BUILDTOOL_STORAGE_COMPACTIFIER_HPP