[darcs-users] darcs patch: Improve memory usage of darcs check and ... (and 1 more)

Eric Kow kowey at darcs.net
Tue Mar 10 18:12:42 UTC 2009


Hi,

On Tue, Mar 10, 2009 at 19:03:46 +0100, Bertram Felgenhauer wrote:
> Tue Mar 10 13:03:57 CET 2009  Bertram Felgenhauer <int-e at gmx.de>
>   * Improve memory usage of darcs check and repair.
>   'applyAndFix' in D.Repository.Repair kept all processed patches around,
>   but only their info is actually needed.

This one seems to make sense.  Petr, what do you think?
I'll apply it tomorrow if I don't hear from you.

> Tue Mar 10 13:04:59 CET 2009  Bertram Felgenhauer <int-e at gmx.de>
>   * Fix typo.

Applying this one right away.

Improve memory usage of darcs check and repair.
-----------------------------------------------
> Bertram Felgenhauer <int-e at gmx.de>**20090310120357
>  'applyAndFix' in D.Repository.Repair kept all processed patches around,
>  but only their info is actually needed.
> ] hunk ./src/Darcs/Repository/Repair.hs 83
>            aaf s NilFL = return ([], s, True)
>            aaf s (p:>:ps) = do
>              (s', mp') <- run_slurpy s $ applyAndTryToFix p
> -            finishedOneIO k $ show $ human_friendly $ info p
> +            let !infp = info p -- assure that 'p' can be garbage collected.
> +            finishedOneIO k $ show $ human_friendly $ infp
>              s'' <- syncSlurpy (update_slurpy r c opts) s'
>              (ps', s''', restok) <- aaf s'' ps
>              case mp' of
> hunk ./src/Darcs/Repository/Repair.hs 91
>                Nothing -> return (ps', s''', restok)
>                Just (e,pp) -> do putStrLn e
>                                  p' <- makePatchLazy r pp
> -                                return ((info p, p'):ps', s''', False)
> +                                return ((infp, p'):ps', s''', False)
>  
>  data RepositoryConsistency p =
>      RepositoryConsistent


Fix typo.
---------
> Bertram Felgenhauer <int-e at gmx.de>**20090310120459] hunk ./src/Darcs/Repository/Repair.hs 139
>                    (ps, s_, ok) <- applyAndFix c opts s repo psin
>                    debugMessage "Done fixing broken patches..."
>                    return (s_, (reverseFL ps :<: NilRL), ok)
> -  debugMessage "Checking pristine agains slurpy"
> +  debugMessage "Checking pristine against slurpy"
>    is_same <- checkPristineAgainstSlurpy repo s' `catchall` return False
>    -- TODO is the latter condition needed? Does a broken patch imply pristine
>    -- difference? Why, or why not?
> 

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20090310/7688953c/attachment.pgp>


More information about the darcs-users mailing list