diff options
| author | Stefan Boberg <[email protected]> | 2021-10-18 09:10:07 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-10-18 09:10:07 +0200 |
| commit | 94efab8e5c00f4b552946d8c1bdc69453020f888 (patch) | |
| tree | df312c80719590c847253e952ea27322187b2d88 /zenstore/gc.cpp | |
| parent | structured cache: Implemented GarbageCollect() for disk and memory buckets (diff) | |
| download | zen-94efab8e5c00f4b552946d8c1bdc69453020f888.tar.xz zen-94efab8e5c00f4b552946d8c1bdc69453020f888.zip | |
gc: moved GcContect from CAS into gc files
Diffstat (limited to 'zenstore/gc.cpp')
| -rw-r--r-- | zenstore/gc.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/zenstore/gc.cpp b/zenstore/gc.cpp index bfb8f015e..e7c8f3a1a 100644 --- a/zenstore/gc.cpp +++ b/zenstore/gc.cpp @@ -1,9 +1,40 @@ // Copyright Epic Games, Inc. All Rights Reserved. #include <zenstore/gc.h> +#include <zenstore/CAS.h> namespace zen { +////////////////////////////////////////////////////////////////////////// + +struct GcContext::GcState +{ + CasChunkSet m_CasChunks; + CasChunkSet m_CidChunks; +}; + +GcContext::GcContext() : m_State(std::make_unique<GcState>()) +{ +} + +GcContext::~GcContext() +{ +} + +void +GcContext::ContributeCids(std::span<const IoHash> Cids) +{ + m_State->m_CidChunks.AddChunksToSet(Cids); +} + +void +GcContext::ContributeCas(std::span<const IoHash> Cas) +{ + m_State->m_CasChunks.AddChunksToSet(Cas); +} + +////////////////////////////////////////////////////////////////////////// + CasGc::CasGc(CasStore& Store) : m_CasStore(Store) { } |