From c364d5d1e36a9f790b0d610aae1d30d8732b58ce Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 23 Nov 2009 16:34:24 +0000 Subject: * Made the garbage collector a lot faster. It no longer computes the complete set of live and dead paths before starting the actual deletion, but determines liveness on demand. I.e. for any path in the store, it first tries to delete all the referrers, and then the path itself. This means that the collector can start deleting paths almost immediately. --- src/libstore/local-store.hh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/libstore/local-store.hh') diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh index 242239898..e851d0509 100644 --- a/src/libstore/local-store.hh +++ b/src/libstore/local-store.hh @@ -174,12 +174,13 @@ private: void upgradeStore12(); - void gcPath(const GCOptions & options, GCResults & results, - const Path & path); - - void gcPathRecursive(const GCOptions & options, - GCResults & results, PathSet & done, const Path & path); + struct GCState; + bool tryToDelete(GCState & state, const Path & path); + + bool isActiveTempFile(const GCState & state, + const Path & path, const string & suffix); + void startSubstituter(const Path & substituter, RunningSubstituter & runningSubstituter); }; -- cgit v1.2.3