diff options
author | Joey Hess <joey@kitenet.net> | 2012-02-15 14:35:49 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-02-15 14:35:49 -0400 |
commit | 505d6b1a06df2d84fd26d9f29025050b7944618a (patch) | |
tree | 056e04347f28ce603ebd736f641c7616f7cecfa2 /CmdLine.hs | |
parent | 4645f836781fd1db91c2b64138d441508a2bb847 (diff) |
fix failure count memory leak
This is the last memory leak that prevents git-annex from running
in constant space, as far as I can see. I can now run git annex find
dummied up to repeatedly find the same file over and over, on millions
olf files, and memory stays entirely constant.
Diffstat (limited to 'CmdLine.hs')
-rw-r--r-- | CmdLine.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/CmdLine.hs b/CmdLine.hs index 0bb345912..fbc1eaeca 100644 --- a/CmdLine.hs +++ b/CmdLine.hs @@ -80,7 +80,9 @@ tryRun' errnum state cmd (a:as) = do a handle (Left err) = showerr err >> cont False state handle (Right (success, state')) = cont success state' - cont success s = tryRun' (if success then errnum else errnum + 1) s cmd as + cont success s = do + let errnum' = if success then errnum else errnum + 1 + (tryRun' $! errnum') s cmd as showerr err = Annex.eval state $ do showErr err showEndFail |