Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
gc-store.hh
Go to the documentation of this file.
1#pragma once
3
4#include <unordered_set>
5
6#include "store-api.hh"
7
8namespace nix {
9
10
11typedef std::unordered_map<StorePath, std::unordered_set<std::string>> Roots;
12
13
15{
30 typedef enum {
31 gcReturnLive,
32 gcReturnDead,
33 gcDeleteDead,
34 gcDeleteSpecific,
35 } GCAction;
36
37 GCAction action{gcDeleteDead};
38
45 bool ignoreLiveness{false};
46
50 StorePathSet pathsToDelete;
51
55 uint64_t maxFreed{std::numeric_limits<uint64_t>::max()};
56};
57
58
60{
65 PathSet paths;
66
71 uint64_t bytesFreed = 0;
72};
73
74
101struct GcStore : public virtual Store
102{
103 inline static std::string operationName = "Garbage collection";
104
112 virtual Roots findRoots(bool censor) = 0;
113
117 virtual void collectGarbage(const GCOptions & options, GCResults & results) = 0;
118};
119
120}
Definition gc-store.hh:15
uint64_t maxFreed
Definition gc-store.hh:55
GCAction
Definition gc-store.hh:30
bool ignoreLiveness
Definition gc-store.hh:45
StorePathSet pathsToDelete
Definition gc-store.hh:50
Definition gc-store.hh:60
PathSet paths
Definition gc-store.hh:65
uint64_t bytesFreed
Definition gc-store.hh:71
Definition gc-store.hh:102
virtual void collectGarbage(const GCOptions &options, GCResults &results)=0
virtual Roots findRoots(bool censor)=0