aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/compactcas.h
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-10-30 09:32:54 +0100
committerGitHub <[email protected]>2023-10-30 09:32:54 +0100
commit3a6a5855cf36967c6bde31292669bfaf832c6f0b (patch)
tree593e7c21e6840e7ad312207fddc63e1934e19d85 /src/zenstore/compactcas.h
parentset up arch properly when running tests (mac) (#505) (diff)
downloadzen-3a6a5855cf36967c6bde31292669bfaf832c6f0b.tar.xz
zen-3a6a5855cf36967c6bde31292669bfaf832c6f0b.zip
New GC implementation (#459)
- Feature: New garbage collection implementation, still in evaluation mode. Enabled by `--gc-v2` command line option
Diffstat (limited to 'src/zenstore/compactcas.h')
-rw-r--r--src/zenstore/compactcas.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/zenstore/compactcas.h b/src/zenstore/compactcas.h
index 478a1f78e..9ff4ae4fc 100644
--- a/src/zenstore/compactcas.h
+++ b/src/zenstore/compactcas.h
@@ -49,7 +49,7 @@ static_assert(sizeof(CasDiskIndexEntry) == 32);
*/
-struct CasContainerStrategy final : public GcStorage
+struct CasContainerStrategy final : public GcStorage, public GcReferenceStore
{
CasContainerStrategy(GcManager& Gc);
~CasContainerStrategy();
@@ -71,6 +71,8 @@ struct CasContainerStrategy final : public GcStorage
virtual void CollectGarbage(GcContext& GcCtx) override;
virtual GcStorageSize StorageSize() const override;
+ virtual GcReferencePruner* CreateReferencePruner(GcCtx& Ctx) override;
+
private:
CasStore::InsertResult InsertChunk(const void* ChunkData, size_t ChunkSize, const IoHash& ChunkHash);
void MakeIndexSnapshot();
@@ -97,6 +99,9 @@ private:
typedef tsl::robin_map<IoHash, size_t, IoHash::Hasher> LocationMap_t;
LocationMap_t m_LocationMap;
std::vector<BlockStoreDiskLocation> m_Locations;
+
+ friend class CasContainerReferencePruner;
+ friend class CasContainerStoreCompactor;
};
void compactcas_forcelink();