From b88adc43bb6ffe914ca9303e3001624e36fd64fa Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Tue, 2 Apr 2024 18:37:16 +0200 Subject: Compactification: Split large entries. During garbage collection split and remove from the storage every entry that is larger than a threshold. --- src/buildtool/storage/compactifier.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/buildtool/storage/compactifier.hpp') 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 + template class LocalCAS; @@ -26,6 +28,16 @@ class Compactifier final { /// entries. [[nodiscard]] static auto RemoveSpliced(LocalCAS 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 const& cas, + size_t threshold) noexcept -> bool; }; #endif // INCLUDED_SRC_BUILDTOOL_STORAGE_COMPACTIFIER_HPP -- cgit v1.2.3