summaryrefslogtreecommitdiff
path: root/src/Mmap.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Mmap.hs')
-rw-r--r--src/Mmap.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Mmap.hs b/src/Mmap.hs
index bfe6042..94f5c49 100644
--- a/src/Mmap.hs
+++ b/src/Mmap.hs
@@ -45,6 +45,8 @@ mapFile path = mask_ $ do
-- fail (and no exceptions are coming from outside as we're masked)
if addr == nullPtr
then fail "mapFile: could not mmap"
- else BS.unsafePackCStringFinalizer addr (fromIntegral @CSize @Int filelen)
- (do -- putStrLn ("[munmap " ++ show addr ++ "]")
- c_munmap addr filelen)
+ else do bs <- BS.unsafePackCStringFinalizer addr (fromIntegral @CSize @Int filelen)
+ (do -- putStrLn ("[munmap " ++ show addr ++ "]")
+ c_munmap addr filelen)
+ -- putStrLn ("[mmap " ++ show addr ++ "]")
+ return bs