Expand description
Mark-sweep garbage collection for content-addressed slices (ADR 0012).
A slice blob is live iff some live manifest references its hash. GC marks the union of every live manifest’s hashes, then sweeps any stored blob outside that set. Liveness is derived from the manifests themselves rather than a maintained refcount, so it is self-correcting: a missed event can leave a slice briefly un-swept, never wrongly deleted, and never leaked forever the way a drifted refcount would.
Structs§
- GcReport
- What a GC sweep did.
Functions§
- gc_
blobs - Sweep
blobs: delete every stored slice nolive_manifestsentry references, and report what was freed vs. retained. Mark-sweep — see the module docs for why this is preferred over refcounting. - live_
slice_ hashes - The mark set: every slice hash referenced by any of the
manifests. - unreferenced_
slices - The sweep set: hashes present in
allbut referenced by no live manifest, returned sorted (all - live).