Nix
2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Toggle main menu visibility
Loading...
Searching...
No Matches
gc-store.hh
Go to the documentation of this file.
1
#pragma once
3
4
#include "
nix/store/store-api.hh
"
5
#include <boost/unordered/unordered_flat_map.hpp>
6
#include <boost/unordered/unordered_flat_set.hpp>
7
8
namespace
nix {
9
10
typedef
boost::unordered_flat_map<
11
StorePath
,
12
boost::unordered_flat_set<std::string, StringViewHash, std::equal_to<>>,
13
std::hash<StorePath>>
14
Roots;
15
30
enum class
GCAction
{
31
gcReturnLive,
32
gcReturnDead,
33
gcDeleteDead,
34
gcDeleteSpecific,
35
};
36
37
struct
GCOptions
38
{
39
using
GCAction =
nix::GCAction
;
40
using
enum GCAction;
41
42
struct
WholeStore
43
{};
44
45
struct
SpecificPaths
46
{
47
StorePathSet paths;
48
52
bool
deleteReferrers
=
false
;
53
};
54
55
GCAction action{gcDeleteDead};
56
63
bool
ignoreLiveness
{
false
};
64
68
using
GCPaths
= std::variant<WholeStore, SpecificPaths>;
69
GCPaths
pathsToDelete;
70
74
uint64_t
maxFreed
{std::numeric_limits<uint64_t>::max()};
75
};
76
77
struct
GCResults
78
{
83
StringSet
paths
;
84
88
uint64_t
bytesFreed
= 0;
89
};
90
117
struct
GcStore
:
public
virtual
Store
118
{
119
private
:
120
void
anchor()
override
;
121
122
public
:
123
inline
static
std::string operationName =
"Garbage collection"
;
124
132
virtual
Roots
findRoots
(
bool
censor) = 0;
133
137
virtual
void
collectGarbage
(
const
GCOptions
& options,
GCResults
& results) = 0;
138
144
virtual
void
deleteBuildTraces
(
const
std::set<DrvOutput> & keys) = 0;
145
};
146
147
}
// namespace nix
nix::StorePath
Definition
path.hh:33
nix::GCAction
GCAction
Definition
gc-store.hh:30
store-api.hh
nix::GCOptions::SpecificPaths
Definition
gc-store.hh:46
nix::GCOptions::SpecificPaths::deleteReferrers
bool deleteReferrers
Definition
gc-store.hh:52
nix::GCOptions::WholeStore
Definition
gc-store.hh:43
nix::GCOptions
Definition
gc-store.hh:38
nix::GCOptions::GCPaths
std::variant< WholeStore, SpecificPaths > GCPaths
Definition
gc-store.hh:68
nix::GCOptions::maxFreed
uint64_t maxFreed
Definition
gc-store.hh:74
nix::GCOptions::ignoreLiveness
bool ignoreLiveness
Definition
gc-store.hh:63
nix::GCResults
Definition
gc-store.hh:78
nix::GCResults::bytesFreed
uint64_t bytesFreed
Definition
gc-store.hh:88
nix::GCResults::paths
StringSet paths
Definition
gc-store.hh:83
nix::GcStore
Definition
gc-store.hh:118
nix::GcStore::collectGarbage
virtual void collectGarbage(const GCOptions &options, GCResults &results)=0
nix::GcStore::findRoots
virtual Roots findRoots(bool censor)=0
nix::GcStore::deleteBuildTraces
virtual void deleteBuildTraces(const std::set< DrvOutput > &keys)=0
nix::StringSet
std::set< std::string, std::less<> > StringSet
Definition
types.hh:45
libstore
include
nix
store
gc-store.hh
Generated by
1.18.0