1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 08:31:16 +02:00

* In the garbage collector, delete invalid paths before deleting

unreachable paths.  This matters when using --max-freed etc.:
  unreachable paths could become reachable again, so it's nicer to
  keep them if there is "real" garbage to be deleted.  Also, don't use
  readDirectory() but read the Nix store and delete invalid paths in
  parallel.  This reduces GC latency on very large Nix stores.
This commit is contained in:
Eelco Dolstra 2011-12-22 15:55:53 +00:00
parent 58d974336c
commit b33da599c5
3 changed files with 45 additions and 12 deletions

View file

@ -701,7 +701,7 @@ AutoCloseDir::AutoCloseDir(DIR * dir)
AutoCloseDir::~AutoCloseDir()
{
if (dir) closedir(dir);
close();
}
@ -717,6 +717,14 @@ AutoCloseDir::operator DIR *()
}
void AutoCloseDir::close()
{
if (dir) {
closedir(dir);
dir = 0;
}
}
//////////////////////////////////////////////////////////////////////

View file

@ -223,6 +223,7 @@ public:
~AutoCloseDir();
void operator =(DIR * dir);
operator DIR *();
void close();
};