[darcs-users] darcs patch: Handle empty files in mmapFilePS. Also cater for FD sh...

Eric Kow kowey at darcs.net
Wed Feb 4 18:13:05 UTC 2009


Hi again,

I guess it would make sense to apply this now, since there's no knowing
how long Don can get around to updating the bytestring-mmap package.

On Wed, Feb 04, 2009 at 18:33:46 +0100, Petr Rockai wrote:
> PS: The patch also changes one occurence of Prelude.catch to
> Control.Exception.catch. Hopefully that doesn't change semantics of
> anything. Prelude.catch is unable to catch the mmap error, and is generally
> unreliable as far as I can tell.

But, first, could you please check on the possible risks on our other
use of the catch function in the ByteStringUtils module?  It looks like
there is only one.

Handle empty files in mmapFilePS. Also cater for FD shortage.
-------------------------------------------------------------
> +  x <- unsafeMMapFile f
> +   `catch` (\_ -> do
> +                     size <- fileSize `fmap` getSymbolicLinkStatus f
> +                     if size == 0
> +                        then return B.empty
> +                        else performGC >> unsafeMMapFile f)

Second: will there be any weird performance consequences if we're
calling performGC on every mmapFilePS?

-- 
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/20090204/fb139d11/attachment.pgp 


More information about the darcs-users mailing list