@@ -353,12 +353,16 @@ data MutArray a =
353-- Pinning & Unpinning
353-- Pinning & Unpinning
354-------------------------------------------------------------------------------
354-------------------------------------------------------------------------------
356+-- | Copy the 'MutArray' to pinned memory if unpinned, else do nothing. The
357+-- overhead is a copy if the input array is unpinned.
356{-# INLINE pin #-}
358{-# INLINE pin #-}
357pin :: MutArray a -> IO (MutArray a)
359pin :: MutArray a -> IO (MutArray a)
358pin arr@MutArray{..} = do
360pin arr@MutArray{..} = do
359 contents <- Unboxed.pin arrContents
361 contents <- Unboxed.pin arrContents
360 return $ arr {arrContents = contents}
362 return $ arr {arrContents = contents}
364+-- | Copy the 'MutArray' to unpinned memory if pinned, else do nothing. The
365+-- overhead is a copy if the input array is pinned.
362{-# INLINE unpin #-}
366{-# INLINE unpin #-}
363unpin :: MutArray a -> IO (MutArray a)
367unpin :: MutArray a -> IO (MutArray a)
364unpin arr@MutArray{..} = do
368unpin arr@MutArray{..} = do