
15 Mar
2007
15 Mar
'07
2:12 a.m.
Quoth dons@cse.unsw.edu.au (Donald Bruce Stewart): ... | In fact, the (commented out code) for mmapFile :: FilePath -> IO ByteString | is in Data.ByteString now. You can also provide munmap as the finaliser, | and let the GC take care of that. It does make more sense to unmap the string when it's the whole file, of course, and I assume it would force the OS to free the memory, if it makes any difference. Is there any cost to GC that can be avoided if there's no finalizer? I mean, in the present case you might generate many thousands of substrings during analysis of the file, so in theory there's a lot less book-keeping needed if there's nothing to do in the end anyway. Donn Cave, donn@drizzle.com