status: Fixed to run in nearly constant space.

Before, it leaked space due to caching lists of keys. Now all necessary
data about keys is calculated as they stream in.

The "nearly constant" is due to getKeysPresent, which builds up a lot
of [] thunks as it traverses .git/annex/objects/. Will deal with it later.
This commit is contained in:
Joey Hess 2012-03-11 17:15:58 -04:00
parent b086e32c63
commit ff3644ad38
4 changed files with 67 additions and 49 deletions

View file

@ -300,7 +300,7 @@ getKeysPresent' dir = do
-- 2 levels of hashing
levela <- dirContents dir
levelb <- mapM dirContents levela
contents <- mapM dirContents (concat levelb)
contents <- unsafeInterleaveIO $ mapM dirContents (concat levelb)
let files = concat contents
return $ mapMaybe (fileKey . takeFileName) files