Skip to content
Snippets Groups Projects
Commit 70cdd96f authored by Andrew Martin's avatar Andrew Martin
Browse files

Use mutableByteArrayContentsShim

parent 38b7d817
No related tags found
No related merge requests found
...@@ -144,7 +144,7 @@ byteArrayAsForeignPtr (ByteArray arr#) = ForeignPtr (byteArrayContents# arr#) (P ...@@ -144,7 +144,7 @@ byteArrayAsForeignPtr (ByteArray arr#) = ForeignPtr (byteArrayContents# arr#) (P
-- the foreign pointer. -- the foreign pointer.
mutableByteArrayAsForeignPtr :: MutableByteArray RealWorld -> ForeignPtr Word8 mutableByteArrayAsForeignPtr :: MutableByteArray RealWorld -> ForeignPtr Word8
{-# INLINE mutableByteArrayAsForeignPtr #-} {-# INLINE mutableByteArrayAsForeignPtr #-}
mutableByteArrayAsForeignPtr (MutableByteArray arr#) = ForeignPtr (mutableByteArrayContents# arr#) (PlainPtr arr#) mutableByteArrayAsForeignPtr (MutableByteArray arr#) = ForeignPtr (mutableByteArrayContentsShim arr#) (PlainPtr arr#)
-- | Yield a pointer to the array's data. This operation is only safe on -- | Yield a pointer to the array's data. This operation is only safe on
-- /pinned/ byte arrays. Byte arrays allocated by 'newPinnedByteArray' and -- /pinned/ byte arrays. Byte arrays allocated by 'newPinnedByteArray' and
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment