summaryrefslogtreecommitdiff
path: root/src/System/IO/MMap
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-07-16 20:25:43 +0400
committerSam T <pxqr.sta@gmail.com>2013-07-16 20:25:43 +0400
commit412919e88e1d60303f7a14134e37f27becf5f959 (patch)
tree89711599f2ca1101c1d905e65516b2778c50fd07 /src/System/IO/MMap
parent8c6e5818ee6b901efd975392c54aff5cf2721ae4 (diff)
~ Move client bitfield to storage.
We localize bitfield mutation in storage module this way. Also fix some warnings.
Diffstat (limited to 'src/System/IO/MMap')
-rw-r--r--src/System/IO/MMap/Fixed.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/System/IO/MMap/Fixed.hs b/src/System/IO/MMap/Fixed.hs
index df6a6603..1e83c350 100644
--- a/src/System/IO/MMap/Fixed.hs
+++ b/src/System/IO/MMap/Fixed.hs
@@ -151,8 +151,8 @@ mallocTo fi s = do
151lookupRegion :: FixedOffset -> Fixed -> Maybe B.ByteString 151lookupRegion :: FixedOffset -> Fixed -> Maybe B.ByteString
152lookupRegion offset Fixed {..} = 152lookupRegion offset Fixed {..} =
153 case intersecting imap $ IntervalCO offset (succ offset) of 153 case intersecting imap $ IntervalCO offset (succ offset) of
154 [(i, (fptr, off))] -> let s = max 0 $ upperBound i - lowerBound i 154 [(i, (fptr, off))] -> let s = upperBound i - lowerBound i
155 in Just $ fromForeignPtr fptr off s 155 in Just $ fromForeignPtr fptr off (max 0 s)
156 _ -> Nothing 156 _ -> Nothing
157 157
158-- | Note: this is unsafe operation. 158-- | Note: this is unsafe operation.