tvl-depot/src/libstore/gc.hh
Eelco Dolstra c505702265 * Fix and simplify the garbage collector (it's still not concurrent,
though).  In particular it's now much easier to register a GC root.
  Just place a symlink to whatever store path it is that you want to
  keep in /nix/var/nix/gcroots.
2005-01-27 15:21:29 +00:00

17 lines
551 B
C++

#ifndef __GC_H
#define __GC_H
#include "util.hh"
/* Garbage collector operation. */
typedef enum { gcReturnLive, gcReturnDead, gcDeleteDead } GCAction;
/* If `action' is set to `soReturnLive', return the set of paths
reachable from (i.e. in the closure of) the specified roots. If
`action' is `soReturnDead', return the set of paths not reachable
from the roots. If `action' is `soDeleteDead', actually delete the
latter set. */
void collectGarbage(const PathSet & roots, GCAction action,
PathSet & result);
#endif /* !__GC_H */