Repository : ssh://darcs.haskell.org//srv/darcs/packages/base

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/cb6f03db3e0df85b47bb6086728cd51d982a46b9

>---------------------------------------------------------------

commit cb6f03db3e0df85b47bb6086728cd51d982a46b9
Author: Joey Adams <[email protected]>
Date:   Mon Dec 24 12:42:01 2012 -0500

    GHC.IO.Buffer: use memmove instead of memcpy in slideContents

>---------------------------------------------------------------

 GHC/IO/Buffer.hs |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/GHC/IO/Buffer.hs b/GHC/IO/Buffer.hs
index 8f677f0..eb46eb1 100644
--- a/GHC/IO/Buffer.hs
+++ b/GHC/IO/Buffer.hs
@@ -256,12 +256,12 @@ slideContents :: Buffer Word8 -> IO (Buffer Word8)
 slideContents buf@Buffer{ bufL=l, bufR=r, bufRaw=raw } = do
   let elems = r - l
   withRawBuffer raw $ \p ->
-      do _ <- memcpy p (p `plusPtr` l) (fromIntegral elems)
+      do _ <- memmove p (p `plusPtr` l) (fromIntegral elems)
          return ()
   return buf{ bufL=0, bufR=elems }
 
-foreign import ccall unsafe "memcpy"
-   memcpy :: Ptr a -> Ptr a -> CSize -> IO (Ptr ())
+foreign import ccall unsafe "memmove"
+   memmove :: Ptr a -> Ptr a -> CSize -> IO (Ptr a)
 
 summaryBuffer :: Buffer a -> String
 summaryBuffer buf = "buf" ++ show (bufSize buf) ++ "(" ++ show (bufL buf) ++ 
"-" ++ show (bufR buf) ++ ")"



_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to