Make the implementation of isPinned more safer
commit6780145ee23703d4feac306a3eb9fffed8083fb9
authorAdithya Kumar <adithya@composewell.com>
dateWed 26 Jul 2023, 18:36 (3 years ago)
parentabdc6e1
core/src/Streamly/Internal/Data/Unbox.hs+1−2
@@ -153,8 +153,7 @@ newBytes Pinned = pinnedNewBytes
153153isPinned :: MutableByteArray -> Bool
154154isPinned (MutableByteArray arr#) =
155155 let pinnedInt = I# (isMutableByteArrayPinned# arr#)
156− -- XXX /= 0 would be safer
157− in pinnedInt == 1
156+ in pinnedInt /= 0
158157
159158
160159{-# INLINE cloneMutableArrayWith# #-}