summaryrefslogtreecommitdiff
path: root/src/Mmap.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2026-04-01 13:59:42 +0200
committerTom Smeding <tom@tomsmeding.com>2026-04-01 13:59:42 +0200
commit42b8b5fbcbe02b02878f8f6e2b98aafc713204be (patch)
tree0201ef780d15ed92620bdcb8fd94dd6dac8ecd32 /src/Mmap.hs
parent0cf6164927411cef088d9c8400a99327efdf0c19 (diff)
Cache, drop chronos
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