Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Data/Memory/PtrMethods.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ memXorWith destination !v source bytes

-- | Copy a set number of bytes from @src to @dst
memCopy :: Ptr Word8 -> Ptr Word8 -> Int -> IO ()
memCopy dst src n = c_memcpy dst src (fromIntegral n)
memCopy dst src n = c_memcpy dst src (fromIntegral n) >>= \_ -> return ()
{-# INLINE memCopy #-}

-- | Set @n number of bytes to the same value @v
Expand Down Expand Up @@ -114,7 +114,7 @@ memConstEqual p1 p2 n = loop 0 0
loop (i+1) (acc .|. e)

foreign import ccall unsafe "memset"
c_memset :: Ptr Word8 -> Word8 -> CSize -> IO ()
c_memset :: Ptr Word8 -> Word8 -> CSize -> IO (Ptr Word8)

foreign import ccall unsafe "memcpy"
c_memcpy :: Ptr Word8 -> Ptr Word8 -> CSize -> IO ()
c_memcpy :: Ptr Word8 -> Ptr Word8 -> CSize -> IO (Ptr Word8)
Loading