On Wed, Feb 04, 2009 at 20:02:52 +0100, Petr Rockai wrote: > Well, I did have a look before sending and I believe it's safe.
Thanks! > It's in the catch handler. This code trips only if unsafeMMapFile fails for > reason other than empty file (which *usually* is the open fd limit). The size > check is fairly expensive to do as well, that's why I only do it when > unsafeMMapFile fails (which is rather cheaper than the file size check, due to > (IMHO) stupid System.Posix.File implementation involving unsafePerformIO). And thanks for pointing that out. Also, sorry for being dense, but could you explain to me explicitly the relationship between file descriptors and garbage collection? I'm not really making the leap here. I'm guessing that it's something to do with this remark in the bytestring-mmap haddock: Memory mapped files will behave as if they were read lazily -- pages from the file will be loaded into memory on demand. And I only guess this because when I use readFile on a whole lot of files, I run out of file descriptors. I just dumbly use a strict version of readFile, which makes the problem go away. But otherwise, the whole mmap fd thing is a bit fuzzy for me :-( Also, how did our old mmap code deal with this situation? -- Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow> PGP Key ID: 08AC04F9
signature.asc
Description: Digital signature
_______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
