diff options
| author | Stefan Boberg <[email protected]> | 2021-11-01 20:00:38 +0100 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-11-01 20:00:38 +0100 |
| commit | 4bd88d177958b10ed0b78b0379f039f95acb5ff1 (patch) | |
| tree | 1e90ced5d20da8ad2234ee7b0de001cafdcab85e /zenstore/include | |
| parent | cid: Added RemapCid() for use in GC (diff) | |
| download | zen-4bd88d177958b10ed0b78b0379f039f95acb5ff1.tar.xz zen-4bd88d177958b10ed0b78b0379f039f95acb5ff1.zip | |
gc: implemented CID remapping for GC
Diffstat (limited to 'zenstore/include')
| -rw-r--r-- | zenstore/include/zenstore/gc.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/zenstore/include/zenstore/gc.h b/zenstore/include/zenstore/gc.h index 46b588570..560642803 100644 --- a/zenstore/include/zenstore/gc.h +++ b/zenstore/include/zenstore/gc.h @@ -6,6 +6,7 @@ #include <zencore/thread.h> #include <span> +#include <functional> #define ZEN_USE_REF_TRACKING 0 // This is not currently functional @@ -13,6 +14,7 @@ namespace zen { class CasStore; class CasGc; +class CidStore; struct IoHash; /** Garbage Collection context object @@ -27,6 +29,8 @@ public: void ContributeCids(std::span<const IoHash> Cid); void ContributeCas(std::span<const IoHash> Hash); + void IterateCids(std::function<void(const IoHash&)> Callback); + void FilterCids(std::span<const IoHash> Cid, std::function<void(const IoHash&)> KeepFunc); void FilterCas(std::span<const IoHash> Cas, std::function<void(const IoHash&)> KeepFunc); @@ -91,6 +95,7 @@ public: void CollectGarbage(); + void SetCidStore(CidStore* Cids); void OnNewCidReferences(std::span<IoHash> Hashes); void OnCommittedCidReferences(std::span<IoHash> Hashes); void OnDroppedCidReferences(std::span<IoHash> Hashes); @@ -99,6 +104,7 @@ private: RwLock m_Lock; std::vector<GcContributor*> m_GcContribs; std::vector<GcStorage*> m_GcStorage; + CidStore* m_CidStore; }; } // namespace zen |