Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Mic92/fast-nix-gc
/ functions
Functions
333 in github.com/Mic92/fast-nix-gc
⨍
Functions
333
◇
Types & classes
29
↓ 108 callers
Method
path
(&self)
difftest/src/main.rs:386
↓ 73 callers
Method
len
(&self)
crates/common/src/db.rs:482
↓ 61 callers
Method
add_path
(&self, name: &str, nar_size: u64)
crates/gc/tests/integration.rs:84
↓ 30 callers
Function
symlink
(target: &Path, link: &Path)
difftest/src/main.rs:282
↓ 28 callers
Method
run_gc_ok
(&self, extra_args: &[&str])
crates/gc/tests/integration.rs:197
↓ 25 callers
Function
add_path
(db: &NixDb, name: &str, nar_size: i64, reg_time: i64)
crates/common/src/db.rs:574
↓ 15 callers
Function
setup
()
crates/common/src/db.rs:537
↓ 14 callers
Method
is_empty
(&self)
crates/common/src/db.rs:486
↓ 14 callers
Method
open
(store_dir: &Path, state_dir: &Path)
crates/common/src/db.rs:26
↓ 14 callers
Function
unlock
(p: &Path)
crates/optimise/src/optimise.rs:694
↓ 13 callers
Method
add_root
(&self, root_name: &str, target: &Pkg)
crates/gc/tests/integration.rs:170
↓ 13 callers
Function
mk_store_path
(store: &Path, name: &str, content: &[u8])
crates/optimise/src/optimise.rs:670
↓ 11 callers
Method
db
(&self)
crates/gc/tests/integration.rs:80
↓ 10 callers
Method
load_graph
Load the full reference graph into memory. Walking it as an in-memory CSR is far cheaper than N point queries.
crates/common/src/db.rs:94
↓ 9 callers
Function
optimise_store
(opts: Options)
crates/optimise/src/optimise.rs:320
↓ 8 callers
Function
add_unchecked
Add an absolute path as an unchecked candidate root if it lies in the store.
crates/gc/src/roots.rs:228
↓ 8 callers
Method
end_delete_node
(&self, node: u32)
crates/gc/src/gc_socket.rs:72
↓ 8 callers
Method
run
Run a command with NIX_CONFIG set, returning stdout.
difftest/src/main.rs:410
↓ 7 callers
Method
add_ref
(&self, referrer: &Pkg, reference: &Pkg)
crates/gc/tests/integration.rs:106
↓ 7 callers
Function
graph
(prefix: &str, paths: &[(&str, &[u32])])
crates/gc/src/gc_socket.rs:372
↓ 7 callers
Function
mk_db
(state: &Path, paths: &[&Path])
crates/optimise/src/optimise.rs:680
↓ 7 callers
Function
run_opts
(store: &Path, state: &Path)
crates/optimise/src/optimise.rs:698
↓ 6 callers
Function
add_ref
(db: &NixDb, referrer: i64, reference: i64)
crates/common/src/db.rs:585
↓ 6 callers
Function
collect_garbage
Main GC: find roots, compute alive closure, delete dead paths.
crates/gc/src/gc.rs:140
↓ 6 callers
Function
delete_generations_older_than
(profile: &Path, cutoff: SystemTime, dry_run: bool)
crates/gc/src/profiles.rs:172
↓ 6 callers
Function
diff_sets
( label: &str, a_name: &str, a: &BTreeSet<String>, b_name: &str, b: &BTreeSet<String>, )
difftest/src/main.rs:506
↓ 6 callers
Method
is_eval
Store path created during evaluation, not by building a derivation.
difftest/src/main.rs:45
↓ 6 callers
Function
run
(*argv: str | Path, env: dict[str, str])
scripts/compare-dry-run.py:145
↓ 6 callers
Function
write_file
(path: &Path, contents: &str)
difftest/src/main.rs:278
↓ 5 callers
Method
compute_closure
Mark all nodes reachable from the given root indices.
crates/common/src/db.rs:498
↓ 5 callers
Function
find_generation_links
(profile: &Path)
crates/gc/src/profiles.rs:36
↓ 5 callers
Function
flock
(f: &fs::File, op: i32)
crates/common/src/temp_roots.rs:23
↓ 5 callers
Method
idx_of
(&self, path: &str)
crates/common/src/db.rs:458
↓ 5 callers
Function
make_writable
Builders chmod -w outputs; restore user write so copy/cleanup work.
difftest/src/main.rs:555
↓ 5 callers
Method
nix
(&self, args: &[&str])
difftest/src/main.rs:427
↓ 5 callers
Method
refs
(&self, node: u32)
crates/common/src/db.rs:491
↓ 5 callers
Function
rename
(from: &Path, to: &Path)
difftest/src/main.rs:287
↓ 5 callers
Function
valid_paths
(state_dir: &Path)
difftest/src/main.rs:496
↓ 4 callers
Method
add
Register `store_path` (full path) as a temp root. After this returns, no GC will delete the path while this process lives.
crates/common/src/temp_roots.rs:84
↓ 4 callers
Function
approx_secs_ago
(t: SystemTime, secs: u64)
crates/gc/src/profiles.rs:291
↓ 4 callers
Function
args
(list: &[&str])
crates/gc/src/main.rs:286
↓ 4 callers
Function
bench_run
(label: &str, iterations: u32, f: impl Fn())
crates/gc/benches/gc_bench.rs:123
↓ 4 callers
Function
delete_old_generations
(profile: &Path, dry_run: bool)
crates/gc/src/profiles.rs:142
↓ 4 callers
Function
diff_sets
(label: str, a_name: str, a: set[str], b_name: str, b: set[str])
scripts/compare-dry-run.py:171
↓ 4 callers
Method
invalidate_ids
Remove paths by their ValidPaths.id in a single transaction. The caller holds the ids from `load_graph`, so deletion is a rowid insert into DeadPaths
crates/common/src/db.rs:322
↓ 4 callers
Function
parse_args_from
(args: Vec<std::ffi::OsString>)
crates/gc/src/main.rs:88
↓ 4 callers
Function
parse_older_than
Parse Nix-style time specs like "30d", "4h", "2w", "1m".
crates/gc/src/profiles.rs:11
↓ 4 callers
Method
run_gc
(&self, extra_args: &[&str])
crates/gc/tests/integration.rs:186
↓ 4 callers
Function
run_two_identical
( min_size: u64, dry_run: bool, )
crates/optimise/src/optimise.rs:743
↓ 4 callers
Function
scan_blob_for_store_paths
Scan a blob (e.g. environ) for embedded store paths using the store-path char alphabet, not arbitrary delimiters.
crates/gc/src/roots.rs:238
↓ 4 callers
Function
store_listing
Store entries on disk, excluding internal `.links`/lock files.
difftest/src/main.rs:485
↓ 4 callers
Method
valid_store_paths
Return all valid store paths parsed into `StorePath`. Rows that don't parse (corrupt DB) are returned as an error rather than silently dropped.
crates/common/src/db.rs:296
↓ 4 callers
Function
with_tree
(src: Path, fn: Callable[[], object])
scripts/compare-dry-run.py:295
↓ 3 callers
Method
add_build_trace
Insert a BuildTraceV3 row (Nix ≥2.35 schema: drvPath is a store path basename, outputPath is a full store path).
crates/gc/tests/integration.rs:144
↓ 3 callers
Method
claim_nodes
Atomically partition `nodes` into (claimed, skipped): skipped nodes are protected; claimed ones are marked pending in the same critical section. Claim
crates/gc/src/gc_socket.rs:105
↓ 3 callers
Method
create
Create (or take over) this process's temp roots file, mirroring Nix's `createTempRootsFile`.
crates/common/src/temp_roots.rs:38
↓ 3 callers
Method
end_delete_unknown
(&self, basename: &str)
crates/gc/src/gc_socket.rs:130
↓ 3 callers
Function
extract_cstr_path
Layout of the prefix of struct vnode_info_path / vnode_fdinfowithpath / proc_regionwithpathinfo: lots of opaque fields, then a NUL-terminated path at
crates/gc/src/roots.rs:435
↓ 3 callers
Function
extract_store_path
Extract the top-level store path from a potentially deeper path. e.g. "/nix/store/abc...-foo/bin/bar" -> "/nix/store/abc...-foo". Validates the basena
crates/gc/src/roots.rs:191
↓ 3 callers
Function
fake_hash
Derive a store hash from the package name so tests don't have to spell out 32 chars by hand. Not a real hash, just stable and unique per name.
crates/gc/tests/integration.rs:26
↓ 3 callers
Method
fast_gc
(&self, dry_run: bool)
difftest/src/main.rs:433
↓ 3 callers
Function
find_roots
Find all GC root node indices by walking gcroots/profiles directories (plus any `extra_dirs`) and scanning running processes.
crates/gc/src/roots.rs:12
↓ 3 callers
Function
full
(name: &str)
crates/common/src/db.rs:533
↓ 3 callers
Method
idx_of_basename
(&self, basename: &str)
crates/common/src/db.rs:463
↓ 3 callers
Function
junk_basename
32 valid base32 hash chars so Nix parses the name as a store path.
difftest/src/main.rs:274
↓ 3 callers
Function
load_link_inodes
Inodes already in `.links/`. Files with these inodes are already deduped and can be skipped without hashing. Uses d_ino from readdir; with 1M+ link en
crates/optimise/src/optimise.rs:56
↓ 3 callers
Function
read_file_root
Read a /proc/sys file whose content is a path (e.g. /proc/sys/kernel/modprobe).
crates/gc/src/roots.rs:282
↓ 3 callers
Function
read_proc_link
Read a /proc symlink, swallowing transient errors (process exited, no perms).
crates/gc/src/roots.rs:273
↓ 3 callers
Method
run
(&self, extra: &[&str])
crates/optimise/benches/optimise_bench.rs:82
↓ 3 callers
Function
setup_profile
Build a temp profile dir with generations 1..=n and a `system` symlink pointing at `system-{current}-link`. Returns the temp dir and profile path.
crates/gc/src/profiles.rs:349
↓ 3 callers
Method
store_dir_typed
`StoreDir` view of `store_dir`. Fails if it isn't valid UTF-8.
crates/common/src/db.rs:288
↓ 3 callers
Function
time
(label: &str, f: impl FnOnce())
crates/optimise/benches/optimise_bench.rs:110
↓ 3 callers
Function
valid_paths
(state_dir: Path)
scripts/compare-dry-run.py:165
↓ 2 callers
Method
add_drv_output
(&self, drv: &Pkg, output_name: &str, out: &Pkg)
crates/gc/tests/integration.rs:133
↓ 2 callers
Function
bench
(n_paths: usize, files_per_path: usize, unique_blobs: usize)
crates/optimise/benches/optimise_bench.rs:120
↓ 2 callers
Function
bench_delete
Build stores up front so only the GC run is timed, and assert the deleted count so a graph with 0 dead paths fails instead of silently benchmarking a
crates/gc/benches/gc_bench.rs:155
↓ 2 callers
Function
bool_setting
`nix config show <key>` parsed as a bool. Returns `default` if `nix` is not in PATH, the key is unknown, or the value is not a bool.
crates/common/src/nix_config.rs:8
↓ 2 callers
Function
clean_links
Remove hard links with link count 1 from .links directory, returning bytes freed. The .links dir can contain millions of entries; stat + unlink per en
crates/gc/src/gc.rs:574
↓ 2 callers
Function
closest_match
Closest CLI flag by edit distance, for "did you mean" hints. Returns None unless a candidate is within distance 3.
crates/common/src/lib.rs:140
↓ 2 callers
Function
copy_tree
Recursively copy a tree, preserving symlinks. Skips `gc-socket`.
difftest/src/main.rs:528
↓ 2 callers
Function
current_generation
(profile: &Path)
crates/gc/src/profiles.rs:63
↓ 2 callers
Function
delete_store_path
Delete a store path from disk, returning bytes freed. Store paths are read-only (chmod a-w on registration); make directories writable before removal,
crates/gc/src/gc.rs:19
↓ 2 callers
Method
derivation_outputs
All (output, drv) pairs that get a DerivationOutputs row.
fuzz/fuzz_targets/gc_graph.rs:159
↓ 2 callers
Method
deriver_of
deriver column values: last write wins per output row.
fuzz/fuzz_targets/gc_graph.rs:150
↓ 2 callers
Method
fast_dead_set
fast-nix-gc dry-run dead set. The output ends with a human-readable summary line; keep only the store paths.
difftest/src/main.rs:457
↓ 2 callers
Function
find_runtime_roots
Scan running processes for store paths they reference. Mirrors Nix's `findRuntimeRootsUnchecked`. Returned candidate paths are *unchecked* — caller mu
crates/gc/src/roots.rs:259
↓ 2 callers
Function
find_temp_roots
Find temp roots from the temproots directory. Each file is named by the PID that wrote it and contains NUL-terminated store paths. A file whose owning
crates/gc/src/roots.rs:680
↓ 2 callers
Function
init
Install the logger. Panics if a logger is already set.
crates/common/src/logging.rs:24
↓ 2 callers
Function
is_in_store
True if `path` is inside the store directory (not just a string prefix like `/nix/store-other`). The next char after the prefix must be '/'.
crates/gc/src/roots.rs:222
↓ 2 callers
Method
is_valid_path
(&self, path: &str)
crates/common/src/db.rs:309
↓ 2 callers
Function
make_store_writable
(real_store_dir: &Path)
crates/common/src/lib.rs:51
↓ 2 callers
Function
nar_hash_nix32
SHA-256 over the NAR serialisation, bare nix32 — the .links filename.
crates/optimise/src/hash.rs:11
↓ 2 callers
Function
nix
(*argv: str | Path)
scripts/compare-dry-run.py:207
↓ 2 callers
Method
nix_gc
(&self, print_dead: bool)
difftest/src/main.rs:447
↓ 2 callers
Function
profile_dirs
Directories scanned for profiles, mirroring nix-collect-garbage: the system profiles dir (recursed, so per-user is covered) and the invoking user's XD
crates/gc/src/profiles.rs:264
↓ 2 callers
Method
protected_unknown_snapshot
Snapshot of protected basenames that are not in the graph.
crates/gc/src/gc_socket.rs:85
↓ 2 callers
Function
remove_old_generations
( dir: &Path, delete_older_than: Option<SystemTime>, dry_run: bool, )
crates/gc/src/profiles.rs:218
↓ 2 callers
Function
remove_stale_auto_link
Remove a dangling link in gcroots/auto. Component match, not substring: "gcroots/automatic" must not qualify.
crates/gc/src/roots.rs:180
↓ 2 callers
Method
run_gc
(&self, extra_args: &[&str])
crates/gc/benches/gc_bench.rs:110
↓ 2 callers
Method
run_gc_keep_outputs_ok
Run GC with keep-outputs enabled via CLI flag.
crates/gc/tests/integration.rs:208
next →
1–100 of 333, ranked by callers